Dependency Property not changing the binded Value (MVVM-Helper)

I just can’t find the missing piece. My UserControl doesn’t update the binded property. I’m creating a new UserControl in my code behind. The SetValue and GetValue method are getting called. If the viewModel is initializing some value, my UserControl gets it. But if I change the text in the Textbox, the viewmodel doesn’t hold… Read More Dependency Property not changing the binded Value (MVVM-Helper)

WPF ContentControl template won't show the content

It’s that time again, trying to achieve trivial parts in WPF. <Window.Resources> <ControlTemplate x:Key="GroupBoxTemplate"> <GroupBox Header="ASD"> <ContentPresenter/> </GroupBox> </ControlTemplate> </Window.Resources> <Grid> <ContentControl Template="{StaticResource GroupBoxTemplate}" > <Button Content="test"/> </ContentControl> </Grid> I above example I am expecting that the button is showing inside the templated groupbox. But all I see is a groupbox, the content presenter doesn’t… Read More WPF ContentControl template won't show the content

WPF datagrid's cells contain a border on their left sides

My WPF DataGrid contains an extra item which can be highlighted when hovering the mouse over it. Which exact property is used to enable/disable it? The following is a snippet of the XAML code used: <DataGrid x:Name="DgMonitor" Grid.Row="0" Margin="10,10,10,5" Background="White" CanUserAddRows="False" RowHeight="34" AutoGenerateColumns="False" HorizontalGridLinesBrush="Transparent" VerticalGridLinesBrush="Transparent" GridLinesVisibility="All" HeadersVisibility="All" CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" SelectionMode="Single" SelectionUnit="FullRow">… Read More WPF datagrid's cells contain a border on their left sides

Datatemplate Binding in Label-Style

I have a class that contains various information like a title, imagesource or a description. To display these in a listbox I used a datatemplate. This works fine. <DataTemplate> <StackPanel Orientation="Horizontal"> <Label Content="{Binding Titel}" /> <Label Content="{Binding Beschreibung}"/> <Label > <AccessText Text="{Binding Version}"/> </Label> <Label Style="{DynamicResource ResourceKey={Binding Resource}}"/> </StackPanel> </DataTemplate> Behind each listbox element I… Read More Datatemplate Binding in Label-Style

Xaml onVisibilityChanged do something

I have element with visibility but I don’t know to do something on isVisibleChanged right way. So lets say I have element with name SomePanel So I can access SomePanel.IsVisibleChanged What I found on the internet is public event DependencyPropertyChangedEventHandler IsSomePanelVisible; somePanel.IsVisibleChanged += IsSomePanelVisible; But I need method after += where can I put my… Read More Xaml onVisibilityChanged do something

Xaml make element through two columns

I have simple grid <Grid > <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> …. On the last row I have TextBlock but I need that text block to take two columns. Problem is that if it take just first column it… Read More Xaml make element through two columns

Combining commonly used WPF-Controls for Reuse

I keep repeating the same code over and over: <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> <StackPanel Orientation="Vertical"> <Label Content="Content 1" VerticalAlignment="Center" HorizontalAlignment="Center"/> <ComboBox Style="{StaticResource CustomComboBox}"/> </StackPanel> </StackPanel> It is always some combination of an Input-Control (TextBox, ComboBox, …) and a Label. I have scouted this Thread, but unfortunately the second answer relies on Bindings; I’d like to define… Read More Combining commonly used WPF-Controls for Reuse

WPF Control Style of Button not detecting IsMouseOver

So am trying to create button style (background opacity to black with 20% alpha and default colour of text changes to clear white) with using ResourceDictionary. I do include file into App.xaml like: <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Style/ButtonStyles.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> and to button am applying x:Key Style="{StaticResource TopBarButtons}" so my style of it looks like (random… Read More WPF Control Style of Button not detecting IsMouseOver