All the controls missing in WPF. Over 1 million downloads.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

194 lines
9.7 KiB

<!--*************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2025 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
***********************************************************************************-->
<local:MaterialDemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.MaterialControls.Views.MaterialProgressBarView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="MaterialProgressBar">
<local:DemoView.Description>
<Paragraph FontSize="14"
FontFamily="Segoe">
<Run>A linear ProgressBar that uses the Material Brushes. It contains properties to animate the indeterminate state.</Run>
<!--##INCLUDE_OPEN_SOURCE
<LineBreak />
<LineBreak />
<Run>This feature is only available in the "Plus" version.</Run>
<LineBreak />
<Hyperlink NavigateUri="https://xceed.com/xceed-toolkit-plus-for-wpf" RequestNavigate="Hyperlink_RequestNavigate">
Click here for more details about Xceed Toolkit Plus for WPF.
</Hyperlink>
##END-->
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/CommonResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</local:DemoView.Resources>
<!--##EXCLUDE_OPEN_SOURCE-->
<Grid>
<StackPanel Margin="10">
<GroupBox Header="Features"
Margin="0,5,0,5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="95" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- First Column-->
<TextBlock Grid.Column="0"
Grid.Row="0"
Text="Indeterminate Indicator Max Length: "
VerticalAlignment="Center"/>
<xctk:DoubleUpDown x:Name="inteterminateIndicatorMaxLengthUpDown"
Grid.Column="1"
Grid.Row="0"
Value="{Binding IndeterminateIndicatorMaxLength, ElementName=materialIndeterminateProgressBar}"
Minimum="{Binding Value, ElementName=inteterminateIndicatorMinLengthUpDown}"
Maximum="1"
Increment="0.01"
Margin="5"
Width="50"
FormatString="N2"
VerticalContentAlignment="Center"
ToolTip="The maximum percentage of the progress bar's size that the indicator will accept. Must be between 0 and 1."/>
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Indeterminate Indicator Min Length: "
VerticalAlignment="Center"/>
<xctk:DoubleUpDown x:Name="inteterminateIndicatorMinLengthUpDown"
Grid.Column="1"
Grid.Row="1"
Value="{Binding IndeterminateIndicatorMinLength, ElementName=materialIndeterminateProgressBar}"
Minimum="0"
Maximum="{Binding Value, ElementName=inteterminateIndicatorMaxLengthUpDown}"
Increment="0.01"
Margin="5"
Width="50"
FormatString="N2"
VerticalContentAlignment="Center"
ToolTip="The minimum percentage of the progress bar's size that the indicator will accept. Must be between 0 and 1."/>
<TextBlock Grid.Column="0"
Grid.Row="2"
Text="Indeterminate Indicator Speed Ratio: "
VerticalAlignment="Center"/>
<xctk:DoubleUpDown Grid.Column="1"
Grid.Row="2"
Value="{Binding IndeterminateIndicatorSpeedRatio, ElementName=materialIndeterminateProgressBar}"
Minimum="0.1"
Maximum="5"
Increment="0.5"
Margin="5"
VerticalContentAlignment="Center" />
<!-- Second Column -->
<TextBlock Grid.Column="2"
Grid.Row="0"
Text="Material Accent Brush: "
VerticalAlignment="Center"
Margin="10,0,0,0" />
<ComboBox Grid.Column="3"
Grid.Row="0"
ItemsSource="{Binding MaterialBrushes, RelativeSource={RelativeSource AncestorType={x:Type local:MaterialDemoView}}}"
SelectedItem="{Binding MaterialAccentBrush, ElementName=materialDeterminateProgressBar}"
ItemTemplate="{StaticResource ColorItemTemplate}"
VerticalAlignment="Center"
Margin="5" />
</Grid>
</GroupBox>
<StackPanel>
<TextBlock Text="Usage:"
Style="{StaticResource Header}" />
<Grid HorizontalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Determinate:" />
<StackPanel Grid.Row="0"
Grid.Column="1"
Orientation="Horizontal">
<xctk:MaterialProgressBar x:Name="materialDeterminateProgressBar"
IsIndeterminate="False"
Width="400"
Height="10"
Maximum="100"
Minimum="0"
Margin="20" />
<TextBlock Text="{Binding Value, ElementName=materialDeterminateProgressBar, StringFormat={}{0:N0}%}"
FontSize="15"
Width="45"
VerticalAlignment="Center"
HorizontalAlignment="Center"/>
</StackPanel>
<Button Grid.Row="0"
Grid.Column="2"
Content="Reset"
Click="ResetButton_Click"
VerticalAlignment="Center"
Padding="10" />
<TextBlock Grid.Row="1"
Grid.Column="0"
Text="Indeterminate:" />
<xctk:MaterialProgressBar x:Name="materialIndeterminateProgressBar"
Grid.Row="1"
Grid.Column="1"
IsIndeterminate="True"
IndeterminateIndicatorSpeedRatio="1"
IndeterminateIndicatorMaxLength="0.25"
IndeterminateIndicatorMinLength="0"
MaterialAccentBrush="{Binding MaterialAccentBrush, ElementName=materialDeterminateProgressBar}"
Width="400"
Height="10"
Margin="20"
HorizontalAlignment="Left"/>
</Grid>
</StackPanel>
</StackPanel>
</Grid>
<!--##END-->
<!--##INCLUDE_OPEN_SOURCE
<Image Source="..\OpenSourceImages\MaterialProgressBar.png" Width="600" Height="400"/>
##END-->
</local:MaterialDemoView>