Is there a way to logically group controls in WPF

Here's the scenario I have a Grid with some TextBlock controls, each in a separate cell in the grid. Logically I want to be able to set the Visibility on them bound to a property in my ViewModel....

Open File Dialog MVVM

Ok I really would like to know how expert MVVM developers handle an openfile dialog in WPF. I don't really want to do this in my ViewModel(where 'Browse' is referenced via a DelegateCommand) void...

How can I remove the border of a WPF window when using luna or classic?

When I display a WPF window with WindowStyle="None", it looks great when using areo. However, when I use luna or classic, it displays an ugly gray border about 5 pixels wide. Of course, if I set...

Wpf dragdrop, how to visually reject the drop during the drag?

During a drag in Wpf, how can the mouse cursor (or perhaps using an adorner) be changed to indicate that the droptarget will not accept the dragged item? I've tried to set e.Effects =...

WPF datagrid empty row at bottom

I bind my datagrid using //fill datagrid public DataTable GameData { get { DataSet ds = new DataSet(); FileStream fs = new FileStream(IMDB.WebPage.Class.Config.XMLPath, ...

C#/WPF: KeyBinding not triggering Command

I have declared <InputBindings> <UserControl.InputBindings> <KeyBinding Key="C" Modifiers="Ctrl" Command="{Binding CopyImageCommand}" /> <KeyBinding Key="V" Modifiers="Ctrl"...

WPF combobox disabled background color

It seems like the background color for a WPF combobox is not overrideable when IsEnabled is set to False. Setting the Foreground property does work correctly. Even using snoop and setting the...

TextBlock TextWrapping not wrapping

When I place a TextBlock inside of a Horizontally Aligned StackPanel it does not wrap. I realize that this is because the available width of the StackPanel is PositiveInfinity but are there any...

How to create custom window chrome in wpf?

How can I create a basic custom window chrome for a WPF window, that doesn't include the close button and still a moveable and resizeable window?

WPF always on top only for parent

I need my window to be always on top but just for his parent. Is it possible to make a window always on top just for the parent ?

Getting "DialogResult can be set only after Window is created and shown as dialog" when implementing WPF MVVM pattern for form closing

I am trying to implement this MVVM pattern for the WPF form closing which is also explained in this blog and I am getting System.InvalidOperationException with error message "DialogResult can be...

Improve WPF DataGrid performance

In my .NET 3.5 WPF Application, I have a WPF DataGrid which will be populated with 500 columns and 50 rows. The performance of App is very very poor in scrolling, or when I do...

How to display a PictureBox from behind code in C#

I know my question sounds basic, but i searched all over the place and found nothing.. this is my code : public MainWindow() { InitializeComponent(); Map newMap = new Map(); ...

How can I add this WPF control into my WinForm?

I know that I must use an ElementHost to display a WPF control in a WinForm, but as the WPF control is third party software and it only comes with an XML file and a DLL file. The control is...

Alternatives to Expression Blend

The transition from Blend 4 to Blend for Visual Studio is scaring me. I have installed the latest CTP for VS2012 Update 2 which includes WPF support for the built-in Blend (no longer using the...

Email Support section with the users address as "From address"

I need to implement a “email support” section in our application. So email “To” address will be [email protected]” and from address will be the email address of the end user.(The end...

Options for embedding Chromium instead of IE WebBrowser control with WPF/C#

Updated for 2020, I've linked my article where I compare the memory footprints of different approaches to hosting HTML WebView in a basic Windows Desktop application: MSEdge WebView2...

Binding to list causes memory leak

When I bind an ItemsSource of a ListBox to a List the binding engine holds on to the list elements after the control is gone. This causes all the list elements to stay in memory. The problem goes...

WPF Application; how to only have one window in the taskbar

At the moment my WPF app opens a new icon in the taskbar when a new window is opened like the default. However, I only want one window in the taskbar at anyone time. Is there a property in the...

AvalonDock - prevent anchorable pane docking in document pane

Is it possible to prevent an anchorable being docked into my documents pane? I want them to be draggable and moved around the screen, but sometimes users drag them into the documents pane which...

WPF: C# How to get selected value of Listbox?

I am trying to fetch the selected value of the listbox. When I actually try LstGroup1.SelectedItem I get the value { BoothID = "4", BoothName = "HP" } and even if i try to get the value from...

How to add Custom Properties to WPF User Control

I've my own User Control including a few buttons and etc. I use this code to bring that UC to screen. <AppUI:XXXX x:Name="ucStaticBtns" HorizontalAlignment="Left" Margin="484,0,0,0"...

Click event on an item template

I have this wpf code for my listbox item: <ListBox x:Name="icTodoList" ItemsSource="{Binding ListControleMachine}" Grid.Column="3"> <ListBox.ItemTemplate> <DataTemplate> ...

Wpf listview item object doubleclick

I have a list of objects that get dynamically created when the window opens. For instance: //Set content for listview sentitems inbox.ItemsSource = from email in _dataDC.emails ...

C# WPF Invoking Windows Media Player

I'm currently passing my time by creating a piano app. Each Key is represented of a simple button with a command which fires at click. This leads to executing this Method in ViewModel: private...

WPF Datagrid checkbox column checked

My datagrid checkbox column: <DataGridTemplateColumn MaxWidth="45"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> ...

WPF One DataTrigger with multiple Values

I have a Slider and a TextBlock on my WPF window. The TextBlock needs to change the background, foreground and font size by the value of the slider, by rang. I built a converter that receives the...

Prism 6.3: Reuse View with different View Model's

I'm in a scenario to reuse a view with two completly independent view models. For example you can think a generic list view to show apples somewhere and somewhere else to show cars. Doesn't really...

Is it possible to override the some of the UI of the default Chromium PDF viewer using CefSharp?

I'm trying to implement a PDF viewer for a Xamarin.Forms WPF application, and I'm using CefSharp to load and render the PDF file. However I've been unable to perform the necessary customizations...

Opening PDFs in WebView2 based on selection in CheckBoxColumn

So, In my WPF application, I want my users to be able to open previews of invoices, so that they may either verify or discard them. I am letting them check rows (each row representing a invoice)...