Current filter:
                                You should refresh the page.
                                  • Hi Guys,

                                    I have a standalone ProgressBarEdit.

                                    I want it to turn green when it is at 100%, otherwise it is red.
                                    How do I do that?

                                    <dxe:ProgressBarEdit
                                    Value="{Binding PercentComplete,Mode=TwoWay}"
                                    Minimum="0"
                                    Maximum="8"
                                    ContentDisplayMode="Value"
                                    IsPercent="True"
                                    DisplayFormatString="Progress: {0:p}">
                                    </dxe:ProgressBarEdit>

                                1 Solution

                                Creation Date Importance Sort by

                                Hello Tony,

                                You have to define this Style:

                                [XAML]
                                <Style x:Key="{themes:ProgressBarEditThemeKey ResourceKey=PanelLeftSideHorizontalStyle, IsThemeIndependent=True}" TargetType="{x:Type ContentControl}"> <Setter Property="Focusable" Value="False" /> <Setter Property="Template" Value="{StaticResource ExecutingTemplate}"/> <Style.Triggers> <DataTrigger Binding="{Binding DataContext.Value, ElementName=LayoutRoot}" Value="100"> <Setter Property="Template" Value="{StaticResource FinishedTemplate}"/> </DataTrigger> </Style.Triggers> </Style>

                                The sample project is attached.

                                Best regards,
                                Mikhail

                                Show all comments
                                • Mikhail Shubin [DevExpress MVP] 03.15.2016

                                  I've attached a screencast

                                • Tony Palumbo 2 03.16.2016

                                  Hi Mikhail,

                                  That's perfect.  Thank you.       

                                • Thomas PEREZ 03.23.2018

                                  And lower on my XAML:

                                  [XAML]
                                  <dx:LoadingDecorator SplashScreenLocation="CenterContainer" x:Name="LoadingDecorator" DataContext="{Binding ElementName=ChartControl, Path=DataContext}" SplashScreenDataContext="{Binding ElementName=ChartControl, Path=DataContext}" IsSplashScreenShown="{Binding IsLoading, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"> <dx:LoadingDecorator.SplashScreenTemplate> <DataTemplate> <dx:WaitIndicator DeferedVisibility="True" Content="{Binding LoadingText, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"> <!--DataContext="{Binding ElementName=LoadingDecorator, Path=SplashScreenDataContext}">--> <dx:WaitIndicator.ContentTemplate> <DataTemplate> <StackPanel Orientation="Vertical" DataContext="{Binding ElementName=LoadingDecorator, Path=SplashScreenDataContext}"> <TextBlock Text="{Binding DataContext.LoadingText , RelativeSource={RelativeSource FindAncestor, AncestorType=dx:WaitIndicator} , UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" /> <dxe:ProgressBarEdit Width="50" Height="10" Minimum="0" Maximum="100" AdditionalForeground="Red" EditValue="{Binding DataContext.LoadingProgressValue , RelativeSource={RelativeSource FindAncestor, AncestorType=dx:WaitIndicator} , UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" /> </StackPanel> </DataTemplate> </dx:WaitIndicator.ContentTemplate> </dx:WaitIndicator> </DataTemplate> </dx:LoadingDecorator.SplashScreenTemplate>
                                • Thomas PEREZ 03.23.2018

                                  Hi,

                                  see above how I declared my progressBarEdit, the style is not applying.

                                  On my resources:

                                  [XAML]
                                  <UserControl.Resources> <!--#region ProgressBar--> <ControlTemplate x:Key="ExecutingTemplate" TargetType="{x:Type ContentControl}"> <Border Margin="0" CornerRadius="3" BorderBrush="DarkRed" BorderThickness="2"> <Border.Background> <LinearGradientBrush EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="Red" Offset="0" /> <GradientStop Color="HotPink" Offset="0.1" /> <GradientStop Color="WhiteSmoke" Offset="0.3" /> <GradientStop Color="WhiteSmoke" Offset="0.5" /> <GradientStop Color="HotPink" Offset="0.65" /> <GradientStop Color="Red" Offset="1" /> </LinearGradientBrush> </Border.Background> </Border> </ControlTemplate> <ControlTemplate x:Key="FinishedTemplate" TargetType="{x:Type ContentControl}"> <Border Margin="0" CornerRadius="3" BorderBrush="Green" BorderThickness="2"> <Border.Background> <LinearGradientBrush EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="Green" Offset="0" /> <GradientStop Color="GreenYellow" Offset="0.1" /> <GradientStop Color="WhiteSmoke" Offset="0.3" /> <GradientStop Color="WhiteSmoke" Offset="0.5" /> <GradientStop Color="GreenYellow" Offset="0.65" /> <GradientStop Color="Green" Offset="1" /> </LinearGradientBrush> </Border.Background> </Border> </ControlTemplate> <Style x:Key="{dxet:ProgressBarEditThemeKey ResourceKey=PanelLeftSideHorizontalStyle, IsThemeIndependent=True}" x:Name="ProgressBarStyle" TargetType="{x:Type ContentControl}"> <Setter Property="Focusable" Value="False" /> <Setter Property="Template" Value="{StaticResource ExecutingTemplate}"/> <Style.Triggers> <DataTrigger Binding="{Binding DataContext.LoadingProgressValue, ElementName=ChartControl}" Value="100"> <Setter Property="Template" Value="{StaticResource FinishedTemplate}"/> </DataTrigger> </Style.Triggers> </Style>

                                  Please help

                                • Ilya (DevExpress Support) 03.23.2018

                                  Hi,
                                  The splash screen is displayed in a separate Window that is managed by a separate thread. It doesn't inherit templates defined in a separate visual tree.
                                  To resolve the issue, move the PanelLeftSideHorizontalStyle, FinishedTemplate, and ExecutingTemplate into the App.Resources collection or directly in ProgressBarEdit.Resources.
                                  I look forward to your results.

                                • Thomas PEREZ 03.28.2018

                                  It worked thank you

                                • Ilya (DevExpress Support) 03.28.2018

                                  You are welcome.