0

I have a StatusBar below the screen in SL4 (using PRISM), just a very simple Telerik RadDockPanel.

I also have a menu (Telerik RibbonView with RadRibbonGroup and RadRibbonToggleButton). When the toggle button is pressed, I want to set the text to 'ON' and 'OFF', and I want to hide the status bar, but... only in XAML (not using code behind).

I believe this is a common SL/WPF coding practice... but how ?

akjoshi
  • 15,374
  • 13
  • 103
  • 121
Patrick Peters
  • 9,456
  • 7
  • 57
  • 106

2 Answers2

0

Have to use EventTrigger (check example bellow on page by link that I provided) and ObjectAnimationUsingKeyFrames to change properties that aren't animated (Text, Visibility so on).

Check good example in other answer on so.

Community
  • 1
  • 1
RredCat
  • 5,259
  • 5
  • 60
  • 100
0

You can specify a DataTrigger in your window like this -

<StatusBar.Style>
    <Style>
        <Style.Triggers>
            <DataTrigger
                Binding="{Binding ElementName=MyRadRibbonToggleButton, Path=IsChecked}"
                Value="True">
                <Setter Property="Grid.Visibility" Value="Collapsed" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
</StatusBar.Style>

In case you can't use ElementName binding then you can use a property in your ViewModel(corresponding to RadRibbonToggleButton state). Similar Trigger can be created for a TextBlock/Label to show On/Off text.

This is how I implement this kind of functionality in WPF/MVVM applications;

You may have to apply some hack to make this work with telerik controls.

akjoshi
  • 15,374
  • 13
  • 103
  • 121