This is a migrated thread and some comments may be shown as answers.

User define Theme - For timebar

1 Answer 35 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
Balaji
Top achievements
Rank 1
Balaji asked on 10 Sep 2011, 01:52 PM
Hi 

Currently , we have the implemented the Zoom in (Item container, Mouse button Left up) and Zoom out (Group Container Mouse up) based on some mouse click events ,  and also some other event in the Timebar control to control the movable selection bar. 

Now i want to apply some , theme at run time, so i just want to take the user control resource to different Xaml file(eg Green Theme , Blue theme and etc) . I have almost copied theme which come along with the Examples and then i have added other events (Like MOuse button up and Down ect , Silder selection changes etc), so now the style has some events,

so when i tried to add the resource dictionary at runtime, system says could able to find the mouse up and left events, How could and accomplish this.

our Requirement is based on the user selection , i need to change the theme (Basically the Item container button , Group container button and it's mouse over color etc ) has to be changed. 

I was able to accomplish , just by changing the Time bar button background color in the code behind by getting the key name and apply new color, since i have the user resourses in teh same file. However i want to accomplish the same using the themes , How could i do this?  I am having the event in the styles

E.g 

<telerik:GroupContainer x:Name="PART_GroupContainer" ItemsSource="{TemplateBinding IntervalGroups}" Grid.Row="0" Grid.RowSpan="2"  telerik:StyleManager.Theme="{StaticResource Theme}" MouseLeftButtonUp="PART_GroupContainer_MouseLeftButtonUp">
                                        <telerik:GroupContainer.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <telerik:LabelMeasurementPanel Slider="{Binding ElementName=PART_Slider}"/>
                                            </ItemsPanelTemplate>
                                        </telerik:GroupContainer.ItemsPanel>
                                        <telerik:GroupContainer.Template>
                                            <ControlTemplate>
                                                <ItemsPresenter/>
                                            </ControlTemplate>
                                        </telerik:GroupContainer.Template>
                                    </telerik:GroupContainer>


[This is inside the Thump control Style]
  <Border BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{StaticResource TimeBar_SelectionThumb_Thumbs_OuterBackground}"
                                MouseLeftButtonDown="Border_MouseLeftButtonDown_1">
                                <Border x:Name="BackgroundAnimation" 
                                    BorderBrush="{StaticResource TimeBar_SelectionThumb_Thumbs_InnerBorder}"
                                    BorderThickness="{StaticResource TimeBar_SelectionThumb_Thumbs_InnerBorder_BorderThickness}"
                                    Background="{TemplateBinding Background}"
                                        />
                            </Border>



Thanks in Advance

1 Answer, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 14 Sep 2011, 03:06 PM
Hello Balaji,

Having in mind the error you receive, it appears that your custom theme is not applied.
Could you please give us more details about the way it is set?
A sample project if possible where the described problem can be observed will help us a lot in giving you the most appropriate solution of your problem.

All the best,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TimeBar
Asked by
Balaji
Top achievements
Rank 1
Answers by
Sia
Telerik team
Share this question
or