|
| 1 | +<UserControl x:Class="MetroDemo.ExampleViews.ProgressBars" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls" |
| 5 | + xmlns:MetroDemo="clr-namespace:MetroDemo" |
| 6 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 7 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 8 | + d:DataContext="{d:DesignInstance MetroDemo:MainWindowViewModel}" |
| 9 | + d:DesignHeight="600" |
| 10 | + d:DesignWidth="800" |
| 11 | + mc:Ignorable="d"> |
| 12 | + |
| 13 | + <UserControl.Resources> |
| 14 | + <ResourceDictionary> |
| 15 | + <Style BasedOn="{StaticResource MahApps.Metro.Styles.MetroHeader}" TargetType="{x:Type Controls:MetroHeader}"> |
| 16 | + <Setter Property="HeaderTemplate"> |
| 17 | + <Setter.Value> |
| 18 | + <DataTemplate> |
| 19 | + <StackPanel Orientation="Vertical" UseLayoutRounding="True"> |
| 20 | + <TextBlock Margin="0 4 0 4" Text="{Binding}" /> |
| 21 | + <Separator /> |
| 22 | + </StackPanel> |
| 23 | + </DataTemplate> |
| 24 | + </Setter.Value> |
| 25 | + </Setter> |
| 26 | + </Style> |
| 27 | + |
| 28 | + <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> |
| 29 | + </ResourceDictionary> |
| 30 | + </UserControl.Resources> |
| 31 | + |
| 32 | + <Grid> |
| 33 | + <ScrollViewer> |
| 34 | + <StackPanel Margin="10" Orientation="Vertical"> |
| 35 | + |
| 36 | + <Controls:MetroHeader Margin="0 0 0 10" Header="ProgressBar"> |
| 37 | + <Grid> |
| 38 | + <Grid.ColumnDefinitions> |
| 39 | + <ColumnDefinition Width="Auto" /> |
| 40 | + <ColumnDefinition Width="Auto" /> |
| 41 | + </Grid.ColumnDefinitions> |
| 42 | + <StackPanel Grid.Column="0" |
| 43 | + Margin="10 0" |
| 44 | + Orientation="Vertical"> |
| 45 | + <Slider x:Name="ProgressValueSlider01" |
| 46 | + Width="250" |
| 47 | + Margin="4" |
| 48 | + Controls:SliderHelper.ChangeValueBy="LargeChange" |
| 49 | + Controls:SliderHelper.EnableMouseWheel="MouseHover" |
| 50 | + AutoToolTipPlacement="TopLeft" |
| 51 | + LargeChange="10" |
| 52 | + Maximum="100" |
| 53 | + Minimum="0" |
| 54 | + Orientation="Horizontal" |
| 55 | + SmallChange="1" |
| 56 | + Style="{DynamicResource MahApps.Metro.Styles.Slider.Win10}" |
| 57 | + Value="25" /> |
| 58 | + <ProgressBar Width="250" |
| 59 | + Margin="4" |
| 60 | + Maximum="100" |
| 61 | + Minimum="0" |
| 62 | + Value="{Binding ElementName=ProgressValueSlider01, Path=Value}" /> |
| 63 | + <ProgressBar Width="250" |
| 64 | + Height="15" |
| 65 | + Margin="4" |
| 66 | + Maximum="100" |
| 67 | + Minimum="0" |
| 68 | + Value="{Binding ElementName=ProgressValueSlider01, Path=Value}" /> |
| 69 | + |
| 70 | + <CheckBox x:Name="IsVisibleCheckBox01" |
| 71 | + Width="250" |
| 72 | + Margin="4" |
| 73 | + Content="IsVisible" |
| 74 | + IsChecked="True" /> |
| 75 | + <CheckBox x:Name="IsIndeterminateCheckBox01" |
| 76 | + Width="250" |
| 77 | + Margin="4" |
| 78 | + Content="IsIndeterminate" |
| 79 | + IsChecked="True" /> |
| 80 | + <ProgressBar Width="250" |
| 81 | + Margin="4" |
| 82 | + IsIndeterminate="{Binding ElementName=IsIndeterminateCheckBox01, Path=IsChecked}" |
| 83 | + Maximum="100" |
| 84 | + Minimum="0" |
| 85 | + Visibility="{Binding ElementName=IsVisibleCheckBox01, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}" |
| 86 | + Value="{Binding ElementName=ProgressValueSlider01, Path=Value}" /> |
| 87 | + </StackPanel> |
| 88 | + <StackPanel Grid.Column="1" |
| 89 | + Margin="10 0" |
| 90 | + Orientation="Horizontal"> |
| 91 | + <ProgressBar Height="250" |
| 92 | + Margin="4" |
| 93 | + Maximum="100" |
| 94 | + Minimum="0" |
| 95 | + Orientation="Vertical" |
| 96 | + Value="{Binding ElementName=ProgressValueSlider01, Path=Value}" /> |
| 97 | + <ProgressBar Width="15" |
| 98 | + Height="250" |
| 99 | + Margin="4" |
| 100 | + Maximum="100" |
| 101 | + Minimum="0" |
| 102 | + Orientation="Vertical" |
| 103 | + Value="{Binding ElementName=ProgressValueSlider01, Path=Value}" /> |
| 104 | + <ProgressBar Height="250" |
| 105 | + Margin="4" |
| 106 | + IsIndeterminate="{Binding ElementName=IsIndeterminateCheckBox01, Path=IsChecked}" |
| 107 | + Maximum="100" |
| 108 | + Minimum="0" |
| 109 | + Orientation="Vertical" |
| 110 | + Visibility="{Binding ElementName=IsVisibleCheckBox01, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}" |
| 111 | + Value="{Binding ElementName=ProgressValueSlider01, Path=Value}" /> |
| 112 | + </StackPanel> |
| 113 | + </Grid> |
| 114 | + </Controls:MetroHeader> |
| 115 | + |
| 116 | + <Controls:MetroHeader Margin="0 0 0 10" Header="MetroProgressBar"> |
| 117 | + <Grid> |
| 118 | + <Grid.ColumnDefinitions> |
| 119 | + <ColumnDefinition Width="Auto" /> |
| 120 | + <ColumnDefinition Width="Auto" /> |
| 121 | + </Grid.ColumnDefinitions> |
| 122 | + <StackPanel Grid.Column="0" |
| 123 | + Margin="10 0" |
| 124 | + Orientation="Vertical"> |
| 125 | + <Slider x:Name="ProgressValueSlider02" |
| 126 | + Width="250" |
| 127 | + Margin="4" |
| 128 | + Controls:SliderHelper.ChangeValueBy="LargeChange" |
| 129 | + Controls:SliderHelper.EnableMouseWheel="MouseHover" |
| 130 | + AutoToolTipPlacement="TopLeft" |
| 131 | + LargeChange="10" |
| 132 | + Maximum="100" |
| 133 | + Minimum="0" |
| 134 | + Orientation="Horizontal" |
| 135 | + SmallChange="1" |
| 136 | + Style="{DynamicResource MahApps.Metro.Styles.Slider.Win10}" |
| 137 | + Value="25" /> |
| 138 | + <Controls:MetroProgressBar Width="250" |
| 139 | + Margin="4" |
| 140 | + Maximum="100" |
| 141 | + Minimum="0" |
| 142 | + Value="{Binding ElementName=ProgressValueSlider02, Path=Value}" /> |
| 143 | + <Controls:MetroProgressBar Width="250" |
| 144 | + Height="15" |
| 145 | + Margin="4" |
| 146 | + Maximum="100" |
| 147 | + Minimum="0" |
| 148 | + Value="{Binding ElementName=ProgressValueSlider02, Path=Value}" /> |
| 149 | + |
| 150 | + <CheckBox x:Name="IsVisibleCheckBox02" |
| 151 | + Width="250" |
| 152 | + Margin="4" |
| 153 | + Content="IsVisible" |
| 154 | + IsChecked="True" /> |
| 155 | + <CheckBox x:Name="IsIndeterminateCheckBox02" |
| 156 | + Width="250" |
| 157 | + Margin="4" |
| 158 | + Content="IsIndeterminate" |
| 159 | + IsChecked="True" /> |
| 160 | + <Controls:MetroProgressBar Width="250" |
| 161 | + Margin="4" |
| 162 | + IsIndeterminate="{Binding ElementName=IsIndeterminateCheckBox02, Path=IsChecked}" |
| 163 | + Maximum="100" |
| 164 | + Minimum="0" |
| 165 | + Visibility="{Binding ElementName=IsVisibleCheckBox02, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}" |
| 166 | + Value="{Binding ElementName=ProgressValueSlider02, Path=Value}" /> |
| 167 | + </StackPanel> |
| 168 | + <StackPanel Grid.Column="1" |
| 169 | + Margin="10 0" |
| 170 | + Orientation="Horizontal"> |
| 171 | + <Controls:MetroProgressBar Height="250" |
| 172 | + Margin="4" |
| 173 | + Maximum="100" |
| 174 | + Minimum="0" |
| 175 | + Orientation="Vertical" |
| 176 | + Value="{Binding ElementName=ProgressValueSlider02, Path=Value}" /> |
| 177 | + <Controls:MetroProgressBar Width="15" |
| 178 | + Height="250" |
| 179 | + Margin="4" |
| 180 | + Maximum="100" |
| 181 | + Minimum="0" |
| 182 | + Orientation="Vertical" |
| 183 | + Value="{Binding ElementName=ProgressValueSlider02, Path=Value}" /> |
| 184 | + <Controls:MetroProgressBar Height="250" |
| 185 | + Margin="4" |
| 186 | + IsIndeterminate="{Binding ElementName=IsIndeterminateCheckBox02, Path=IsChecked}" |
| 187 | + Maximum="100" |
| 188 | + Minimum="0" |
| 189 | + Orientation="Vertical" |
| 190 | + Visibility="{Binding ElementName=IsVisibleCheckBox02, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}" |
| 191 | + Value="{Binding ElementName=ProgressValueSlider02, Path=Value}" /> |
| 192 | + </StackPanel> |
| 193 | + </Grid> |
| 194 | + </Controls:MetroHeader> |
| 195 | + |
| 196 | + <Controls:MetroHeader Margin="0 0 0 10" Header="MetroProgressBar"> |
| 197 | + <StackPanel MinHeight="150" |
| 198 | + Margin="10 0" |
| 199 | + Orientation="Vertical"> |
| 200 | + <StackPanel Margin="4" |
| 201 | + HorizontalAlignment="Left" |
| 202 | + Orientation="Horizontal"> |
| 203 | + <CheckBox x:Name="IsActiveCheckBox" |
| 204 | + MinWidth="100" |
| 205 | + Margin="4" |
| 206 | + Content="IsActive" |
| 207 | + IsChecked="True" /> |
| 208 | + <CheckBox x:Name="IsLargeCheckBox" |
| 209 | + MinWidth="100" |
| 210 | + Margin="4" |
| 211 | + Content="IsLarge" |
| 212 | + IsChecked="True" /> |
| 213 | + <CheckBox x:Name="IsVisibleCheckBox03" |
| 214 | + MinWidth="100" |
| 215 | + Margin="4" |
| 216 | + Content="IsVisible" |
| 217 | + IsChecked="True" /> |
| 218 | + </StackPanel> |
| 219 | + <StackPanel Margin="4" |
| 220 | + HorizontalAlignment="Left" |
| 221 | + Orientation="Horizontal"> |
| 222 | + <Controls:ProgressRing IsActive="{Binding ElementName=IsActiveCheckBox, Path=IsChecked}" |
| 223 | + IsLarge="{Binding ElementName=IsLargeCheckBox, Path=IsChecked}" |
| 224 | + Visibility="{Binding ElementName=IsVisibleCheckBox03, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}" /> |
| 225 | + <Controls:ProgressRing Width="40" |
| 226 | + Height="40" |
| 227 | + IsActive="{Binding ElementName=IsActiveCheckBox, Path=IsChecked}" |
| 228 | + IsLarge="{Binding ElementName=IsLargeCheckBox, Path=IsChecked}" |
| 229 | + ToolTip="Magic happens!" |
| 230 | + Visibility="{Binding ElementName=IsVisibleCheckBox03, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}" /> |
| 231 | + <Controls:ProgressRing Width="20" |
| 232 | + Height="20" |
| 233 | + IsActive="{Binding ElementName=IsActiveCheckBox, Path=IsChecked}" |
| 234 | + IsLarge="{Binding ElementName=IsLargeCheckBox, Path=IsChecked}" |
| 235 | + Visibility="{Binding ElementName=IsVisibleCheckBox03, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}" /> |
| 236 | + </StackPanel> |
| 237 | + </StackPanel> |
| 238 | + </Controls:MetroHeader> |
| 239 | + |
| 240 | + </StackPanel> |
| 241 | + </ScrollViewer> |
| 242 | + </Grid> |
| 243 | + |
| 244 | +</UserControl> |
0 commit comments