Skip to content

Commit

Permalink
Added demo combo boxfor HorizontalContentAlignment binding in demo cl…
Browse files Browse the repository at this point in the history
…ient apps
  • Loading branch information
Dirkster99 committed Jul 17, 2022
1 parent e814e88 commit cee8c39
Show file tree
Hide file tree
Showing 14 changed files with 196 additions and 14 deletions.
16 changes: 16 additions & 0 deletions source/Demo/UpDownDemoLib/ViewModels/BaseUpDownViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public abstract class BaseUpDownViewModel<T> : UpDownDemoLib.ViewModels.Base.Vie
private bool _IsHexDisplayEnabled = false;
protected string _FormatString = "D";
protected string _NumberStyle = "None";
protected System.Windows.HorizontalAlignment _HzntalContentAlignment = System.Windows.HorizontalAlignment.Left;
#endregion fields

#region CTors
Expand Down Expand Up @@ -202,6 +203,21 @@ public string NumberStyle
}
}
#endregion HEX DISPLAY ON/OFF Properties

/// <summary>Get/sets the the Alignment style <see cref="System.Windows.HorizontalAlignment"/> that defines the alignment (left, right, center) of the value display in the textbox portion.</summary>
public System.Windows.HorizontalAlignment HzntalContentAlignment
{
get { return _HzntalContentAlignment; }
set
{
if (_HzntalContentAlignment != value)
{
_HzntalContentAlignment = value;
NotifyPropertyChanged(() => HzntalContentAlignment);
}
}
}

#endregion properties

#region methods
Expand Down
13 changes: 13 additions & 0 deletions source/Demo/UpDownDemoLib/Views/ByteUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="5"
FormatString="{Binding FormatString, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsDisplayLengthFixed="True"
Expand Down Expand Up @@ -163,6 +164,18 @@
IsChecked="{Binding Path=IsHexDisplayEnabled, Mode=TwoWay}"
ToolTip="" />

<ComboBox
Width="120"
Margin="21,0,0,0"
IsEditable="False"
Text="{Binding Path=HzntalContentAlignment, Mode=TwoWay}"
ToolTip="Changes the alignment of the text shown in the textbox portion"
ToolTipService.IsEnabled="True">
<ComboBoxItem>Left</ComboBoxItem>
<ComboBoxItem>Center</ComboBoxItem>
<ComboBoxItem>Right</ComboBoxItem>
<ComboBoxItem>Stretch</ComboBoxItem>
</ComboBox>
</StackPanel>

<StackPanel Margin="0,6,0,0">
Expand Down
14 changes: 14 additions & 0 deletions source/Demo/UpDownDemoLib/Views/DecimalUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="10"
IsDisplayLengthFixed="True"
IsMouseDragEnabled="{Binding ElementName=IsMouseDragEnabledCheckBox, Path=IsChecked}"
Expand Down Expand Up @@ -153,6 +154,19 @@
Content="Is Large Step Enabled"
IsChecked="{Binding ElementName=SampleUpDown, Path=IsLargeStepEnabled, Mode=TwoWay}"
ToolTip="Setting this controls whether large step increments can be input via mouse drag or keyboard." />

<ComboBox
Width="120"
Margin="21,0,0,0"
IsEditable="False"
Text="{Binding Path=HzntalContentAlignment, Mode=TwoWay}"
ToolTip="Changes the alignment of the text shown in the textbox portion"
ToolTipService.IsEnabled="True">
<ComboBoxItem>Left</ComboBoxItem>
<ComboBoxItem>Center</ComboBoxItem>
<ComboBoxItem>Right</ComboBoxItem>
<ComboBoxItem>Stretch</ComboBoxItem>
</ComboBox>
</StackPanel>

<StackPanel Margin="0,6,0,0">
Expand Down
14 changes: 14 additions & 0 deletions source/Demo/UpDownDemoLib/Views/DoubleUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="7"
FormatString="F4"
IsDisplayLengthFixed="True"
Expand Down Expand Up @@ -154,6 +155,19 @@
Content="Is Large Step Enabled"
IsChecked="{Binding ElementName=SampleUpDown, Path=IsLargeStepEnabled, Mode=TwoWay}"
ToolTip="Setting this controls whether large step increments can be input via mouse drag or keyboard." />

<ComboBox
Width="120"
Margin="21,0,0,0"
IsEditable="False"
Text="{Binding Path=HzntalContentAlignment, Mode=TwoWay}"
ToolTip="Changes the alignment of the text shown in the textbox portion"
ToolTipService.IsEnabled="True">
<ComboBoxItem>Left</ComboBoxItem>
<ComboBoxItem>Center</ComboBoxItem>
<ComboBoxItem>Right</ComboBoxItem>
<ComboBoxItem>Stretch</ComboBoxItem>
</ComboBox>
</StackPanel>

<StackPanel Margin="0,6,0,0">
Expand Down
14 changes: 14 additions & 0 deletions source/Demo/UpDownDemoLib/Views/FloatUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="5"
IsDisplayLengthFixed="True"
IsMouseDragEnabled="{Binding ElementName=IsMouseDragEnabledCheckBox, Path=IsChecked}"
Expand Down Expand Up @@ -153,6 +154,19 @@
Content="Is Large Step Enabled"
IsChecked="{Binding ElementName=SampleUpDown, Path=IsLargeStepEnabled, Mode=TwoWay}"
ToolTip="Setting this controls whether large step increments can be input via mouse drag or keyboard." />

<ComboBox
Width="120"
Margin="21,0,0,0"
IsEditable="False"
Text="{Binding Path=HzntalContentAlignment, Mode=TwoWay}"
ToolTip="Changes the alignment of the text shown in the textbox portion"
ToolTipService.IsEnabled="True">
<ComboBoxItem>Left</ComboBoxItem>
<ComboBoxItem>Center</ComboBoxItem>
<ComboBoxItem>Right</ComboBoxItem>
<ComboBoxItem>Stretch</ComboBoxItem>
</ComboBox>
</StackPanel>

<StackPanel Margin="0,6,0,0">
Expand Down
18 changes: 16 additions & 2 deletions source/Demo/UpDownDemoLib/Views/LongUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="5"
IsDisplayLengthFixed="True"
FormatString="{Binding FormatString, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
NumberStyle="{Binding NumberStyle, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsDisplayLengthFixed="True"
IsMouseDragEnabled="{Binding ElementName=IsMouseDragEnabledCheckBox, Path=IsChecked}"
IsReadOnly="False"
LargeStepSize="{Binding LargeStepSize, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
MaxValue="{Binding MaximumValue}"
MinValue="{Binding MinimumValue}"
MouseWheelAccelaratorKey="{Binding AccelModifierKey, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
NumberStyle="{Binding NumberStyle, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
StepSize="{Binding StepSize, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding ToolTip, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
Value="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
Expand Down Expand Up @@ -161,6 +162,19 @@
Content="Is Hex Display Enabled"
IsChecked="{Binding Path=IsHexDisplayEnabled, Mode=TwoWay}"
ToolTip="" />

<ComboBox
Width="120"
Margin="21,0,0,0"
IsEditable="False"
Text="{Binding Path=HzntalContentAlignment, Mode=TwoWay}"
ToolTip="Changes the alignment of the text shown in the textbox portion"
ToolTipService.IsEnabled="True">
<ComboBoxItem>Left</ComboBoxItem>
<ComboBoxItem>Center</ComboBoxItem>
<ComboBoxItem>Right</ComboBoxItem>
<ComboBoxItem>Stretch</ComboBoxItem>
</ComboBox>
</StackPanel>

<StackPanel Margin="0,6,0,0">
Expand Down
14 changes: 14 additions & 0 deletions source/Demo/UpDownDemoLib/Views/NumericUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="5"
FormatString="{Binding FormatString, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsDisplayLengthFixed="True"
Expand Down Expand Up @@ -161,6 +162,19 @@
Content="Is Hex Display Enabled"
IsChecked="{Binding Path=IsHexDisplayEnabled, Mode=TwoWay}"
ToolTip="" />

<ComboBox
Width="120"
Margin="21,0,0,0"
IsEditable="False"
Text="{Binding Path=HzntalContentAlignment, Mode=TwoWay}"
ToolTip="Changes the alignment of the text shown in the textbox portion"
ToolTipService.IsEnabled="True">
<ComboBoxItem>Left</ComboBoxItem>
<ComboBoxItem>Center</ComboBoxItem>
<ComboBoxItem>Right</ComboBoxItem>
<ComboBoxItem>Stretch</ComboBoxItem>
</ComboBox>
</StackPanel>

<StackPanel Margin="0,6,0,0">
Expand Down
14 changes: 14 additions & 0 deletions source/Demo/UpDownDemoLib/Views/PercentageUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="7"
IsDisplayLengthFixed="True"
IsMouseDragEnabled="{Binding ElementName=IsMouseDragEnabledCheckBox, Path=IsChecked}"
Expand Down Expand Up @@ -163,6 +164,19 @@
Content="Is Large Step Enabled"
IsChecked="{Binding ElementName=SampleUpDown, Path=IsLargeStepEnabled, Mode=TwoWay}"
ToolTip="Setting this controls whether large step increments can be input via mouse drag or keyboard." />

<ComboBox
Width="120"
Margin="21,0,0,0"
IsEditable="False"
Text="{Binding Path=HzntalContentAlignment, Mode=TwoWay}"
ToolTip="Changes the alignment of the text shown in the textbox portion"
ToolTipService.IsEnabled="True">
<ComboBoxItem>Left</ComboBoxItem>
<ComboBoxItem>Center</ComboBoxItem>
<ComboBoxItem>Right</ComboBoxItem>
<ComboBoxItem>Stretch</ComboBoxItem>
</ComboBox>
</StackPanel>

<StackPanel Margin="0,6,0,0">
Expand Down
14 changes: 14 additions & 0 deletions source/Demo/UpDownDemoLib/Views/SByteUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="5"
FormatString="{Binding FormatString, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsDisplayLengthFixed="True"
Expand Down Expand Up @@ -162,6 +163,19 @@
Content="Is Hex Display Enabled"
IsChecked="{Binding Path=IsHexDisplayEnabled, Mode=TwoWay}"
ToolTip="" />

<ComboBox
Width="120"
Margin="21,0,0,0"
IsEditable="False"
Text="{Binding Path=HzntalContentAlignment, Mode=TwoWay}"
ToolTip="Changes the alignment of the text shown in the textbox portion"
ToolTipService.IsEnabled="True">
<ComboBoxItem>Left</ComboBoxItem>
<ComboBoxItem>Center</ComboBoxItem>
<ComboBoxItem>Right</ComboBoxItem>
<ComboBoxItem>Stretch</ComboBoxItem>
</ComboBox>
</StackPanel>

<StackPanel Margin="0,6,0,0">
Expand Down
14 changes: 14 additions & 0 deletions source/Demo/UpDownDemoLib/Views/ShortUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="5"
FormatString="{Binding FormatString, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsDisplayLengthFixed="True"
Expand Down Expand Up @@ -162,6 +163,19 @@
Content="Is Hex Display Enabled"
IsChecked="{Binding Path=IsHexDisplayEnabled, Mode=TwoWay}"
ToolTip="" />

<ComboBox
Width="120"
Margin="21,0,0,0"
IsEditable="False"
Text="{Binding Path=HzntalContentAlignment, Mode=TwoWay}"
ToolTip="Changes the alignment of the text shown in the textbox portion"
ToolTipService.IsEnabled="True">
<ComboBoxItem>Left</ComboBoxItem>
<ComboBoxItem>Center</ComboBoxItem>
<ComboBoxItem>Right</ComboBoxItem>
<ComboBoxItem>Stretch</ComboBoxItem>
</ComboBox>
</StackPanel>

<StackPanel Margin="0,6,0,0">
Expand Down
14 changes: 14 additions & 0 deletions source/Demo/UpDownDemoLib/Views/UIntegerUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="10"
FormatString="{Binding FormatString, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsDisplayLengthFixed="True"
Expand Down Expand Up @@ -163,6 +164,19 @@
Content="Is Hex Display Enabled"
IsChecked="{Binding Path=IsHexDisplayEnabled, Mode=TwoWay}"
ToolTip="" />

<ComboBox
Width="120"
Margin="21,0,0,0"
IsEditable="False"
Text="{Binding Path=HzntalContentAlignment, Mode=TwoWay}"
ToolTip="Changes the alignment of the text shown in the textbox portion"
ToolTipService.IsEnabled="True">
<ComboBoxItem>Left</ComboBoxItem>
<ComboBoxItem>Center</ComboBoxItem>
<ComboBoxItem>Right</ComboBoxItem>
<ComboBoxItem>Stretch</ComboBoxItem>
</ComboBox>
</StackPanel>

<StackPanel Margin="0,6,0,0">
Expand Down
14 changes: 14 additions & 0 deletions source/Demo/UpDownDemoLib/Views/ULongUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="5"
FormatString="{Binding FormatString, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsDisplayLengthFixed="True"
Expand Down Expand Up @@ -162,6 +163,19 @@
Content="Is Hex Display Enabled"
IsChecked="{Binding Path=IsHexDisplayEnabled, Mode=TwoWay}"
ToolTip="" />

<ComboBox
Width="120"
Margin="21,0,0,0"
IsEditable="False"
Text="{Binding Path=HzntalContentAlignment, Mode=TwoWay}"
ToolTip="Changes the alignment of the text shown in the textbox portion"
ToolTipService.IsEnabled="True">
<ComboBoxItem>Left</ComboBoxItem>
<ComboBoxItem>Center</ComboBoxItem>
<ComboBoxItem>Right</ComboBoxItem>
<ComboBoxItem>Stretch</ComboBoxItem>
</ComboBox>
</StackPanel>

<StackPanel Margin="0,6,0,0">
Expand Down
14 changes: 14 additions & 0 deletions source/Demo/UpDownDemoLib/Views/UShortUpDownDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Margin="3"
HorizontalAlignment="Left"
VerticalAlignment="Top"
HorizontalContentAlignment="{Binding HzntalContentAlignment}"
DisplayLength="5"
FormatString="{Binding FormatString, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
IsDisplayLengthFixed="True"
Expand Down Expand Up @@ -162,6 +163,19 @@
Content="Is Hex Display Enabled"
IsChecked="{Binding Path=IsHexDisplayEnabled, Mode=TwoWay}"
ToolTip="" />

<ComboBox
Width="120"
Margin="21,0,0,0"
IsEditable="False"
Text="{Binding Path=HzntalContentAlignment, Mode=TwoWay}"
ToolTip="Changes the alignment of the text shown in the textbox portion"
ToolTipService.IsEnabled="True">
<ComboBoxItem>Left</ComboBoxItem>
<ComboBoxItem>Center</ComboBoxItem>
<ComboBoxItem>Right</ComboBoxItem>
<ComboBoxItem>Stretch</ComboBoxItem>
</ComboBox>
</StackPanel>

<StackPanel Margin="0,6,0,0">
Expand Down
Loading

0 comments on commit cee8c39

Please sign in to comment.