Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Dimming the indicator of a custom progressbar

Dimming the indicator of a custom progressbar

Scheduled Pinned Locked Moved WPF
wpfcsharphtmlcssdatabase
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 2 Offline
    2 Offline
    2hdass
    wrote on last edited by
    #1

    Hi there, I am new to WPF, I have just learned how to customize the progressbar by using a control template. I made it so that the indicator part of the progressbar has a gradient effect. Now i actually want it to fade in as the value increase, I know that I can make use of the triggers on the value of the progress bar and set the opacity of the indicator, but i am not sure how that can be done. Also, I would like to have a box following the top of the indicator to indicate the value of the progessbar, my approach is to create another column from the grid, place a textbox inside, and then again using trigger change the coordinates of the box. But i am not sure how i can convert the value of the progressbar to the coordinates of the textbox. here is what i have so far

    <UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    x:Class="IceControls.CivicProgressbar"
    x:Name="UserControl" d:DesignHeight="492" Width="50">
    <UserControl.Resources>

        <ControlTemplate x:Key="templateThermometer"
                         TargetType="{x:Type ProgressBar}">
    
            <ControlTemplate.Resources>
                <LinearGradientBrush x:Key="brushStem" 
                                     StartPoint="0 0" EndPoint="7 0">
    				<LinearGradientBrush.Transform>
    					<RotateTransform  Angle="90"></RotateTransform>
    				</LinearGradientBrush.Transform>
                    <GradientStop Offset="0" Color="white" />
    				<GradientStop Offset="1" Color="transparent" />
                </LinearGradientBrush>
    
            </ControlTemplate.Resources>
    		
          
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="\*" />
                </Grid.RowDefinitions>
    
              
                <Grid Grid.Row="0">
                    <Grid.ColumnDefinitions>
    					<ColumnDefinition Width="100\*" />
                    </Grid.ColumnDefinitions>
    
                  
                    <Border Grid.Column="0" BorderBrush="Gray" 
                            BorderThickness="1 1 1 1"
                            CornerRadius="6 6 0 0" >
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups