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

How to change an XAML glyph from C#?

I have an XAML label that shows an empty box. It’s using a glyph font-family similar to Microsoft’s MDL2 assets (except cross-platform). <Label Content="&#xE739;" FontFamily="avares://HomeworkCalendar/Assets/Fonts#Symbols" PointerEnter="Check_OnPointerEnter" PointerLeave="Check_OnPointerLeave"/> When the user hovers over the element I change it from a box to a checkbox. private void Check_OnPointerEnter(object? sender, PointerEventArgs e) { var label = (Label)sender!; label.Content… Read More How to change an XAML glyph from C#?

Remove space between widgets in row flutter

I need to remove the space between two or more Text widgets in a Row. This is the code using a Row Row( mainAxisAlignment: MainAxisAlignment.start, // textBaseline: TextBaseline.alphabetic, // crossAxisAlignment: CrossAxisAlignment.baseline, children: [ Text( r’$ ‘ + formatNumber(valueText), style: TextStyle( color: Color(0xff210049), fontSize: smallTextSize, fontFamily: ‘RedHat’, ), ), Text( ‘,00’, style: TextStyle( color: Color(0xff210049), fontSize:… Read More Remove space between widgets in row flutter