In my WPF C# project i wanted to use the DecimalUpDown control but it doesn't have the same feel and look as my other controls in the UserControl because i am Using MaterialDesignThemes in MaterialDesignInXamlToolkit. Now what i wanted is to Customize the TextBox part of the DecimalUpDown of the ExtendedWPFToolkit and the Button Part so that they look like materialDesignFloatingHintTextBox and one of the MaterialDesignButton styles respectively. I tried that but can't find anywhere to start like the Source Code etc
Where can i get the xctk:DecimalUpDown xaml so that i can Customize the way i want it?
89 Views Asked by Moha At
2
There are 2 best solutions below
3

try using userControle as UI Element
<UserControl x:Class="namespace.Views.MyUpAndDown"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:namespace.Views"
mc:Ignorable="d"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
d:DesignHeight="80" d:DesignWidth="200">
<StackPanel Orientation="Horizontal">
<TextBlock Background="{StaticResource MaterialDesignCardBackground}" MinWidth="140" Text="{Binding Value}"/>
<StackPanel Margin="5" HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Vertical">
<Button Margin="1" Command="{Binding Increment}">
<Button.Content>
<materialDesign:PackIcon Kind="ArrowTop"/>
</Button.Content>
</Button>
<Button Margin="1" Command="{Binding Descrement}">
<Button.Content>
<materialDesign:PackIcon Kind="ArrowDown"/>
</Button.Content>
</Button>
</StackPanel>
</StackPanel>
The source code for the
DecimalUpDown
control is available on GitHub.Here you will also find the default template that you can customize however you want.