Telerik Forums
UI for WPF Forum
1 answer
373 views

Hi,

 

We are using RadRibbonView that contains RibbonTab with a number of Ribbon Groups.  I want to show a textbox (for search functionality) and I want to be aligned to the right of the ribbon view.   If I added this textbox inside a spate Ribbon Group, then that group is appended to the rest of the group, and not aligned to the right.  Also, I tried to create a grid inside the Ribbon tab and set all the group on one column, and then have that textbox on the second  column, but apparently Ribbon Tabs doesn’t accept Grid inside, I got a run time error.

 

Any idea how I can achieve this?!

 

Regards

Petar Mladenov
Telerik team
 answered on 21 Nov 2011
3 answers
139 views
In our application we use attached behaviors on RadControls in a number of places to avoid code-behind (mvvm pattern). These are used for some custom validation logic in grids, automatic significant digits displays on NumericUpDowns, and many others. After updating to the latest release (2011.3.1116.35) the following error occurs on all of these behaviors:

Cannot add content of type 'Behaviors.DynamicDecimalDigitsBehavior' to an object of type 'System.Windows.Interactivity.BehaviorCollection'.  Error at object 'Behaviors.DynamicDecimalDigitsBehavior' in markup file 'setdatarenderingpropertiesview.xaml' Line 270 Position 22.

The project is built in .Net 3.5, and as such we reference System.Windows.Interactivity version 3.5.0.0. 
Devlin
Top achievements
Rank 1
 answered on 21 Nov 2011
6 answers
128 views
Hello,

I am prototyping a user interface.  Basic slimmed down requirements are that I have a list of items on left side of page for the user to select.  On the right side of the list there will be a large view that contains information about the item that was selected in the list.  I have put together UI like this many times and also have used many telerik controls in our applications.  The TileView caught my eye for this one, thinking that I may be able to have something that serves the purpose and provides a bit of modern look and feel rather than just a list.

I practice MVVM and use prism with unity injection.

So what I am looking to get from this control is a templated list of items on left side in a single column.  When one is selected a templated view of the information related to the selection animates (maximizes) over to the right.  I do not want to ever have the items in a tiled view with several columnns and I do not want to have to Maximize in order to see information on the right side. 

Can you let me know if I am going to be able to achieve this functionality with the control?  In addition, if this is possible, could you provide a simple example for me to download?

Thanks,

Jason Munger
Osmose
Avrohom Yisroel
Top achievements
Rank 1
 answered on 21 Nov 2011
7 answers
794 views
Exception : {"'System.Windows.Documents.Hyperlink' is not a Visual or Visual3D."}

My XAML:

<telerik:RadTreeView  ItemsSource="{Binding Doklad.polozky}">
  
  
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                                <TextBlock Grid.Column="2">
                                    <Hyperlink TextDecorations="None" 
                                               Command="{Binding EditPolozkaCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}"
                                               CommandParameter="{Binding}">    
                                    <Image  Grid.Column="2"  Width="16" Source="/Assets/Icons/Edit.png" Cursor="Hand"/>
                                    </Hyperlink>
                                </TextBlock>
  
                            </Grid>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
  
                </telerik:RadTreeView>



StackTrace:

   at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
   at MS.Internal.Media.VisualTreeUtils.AsNonNullVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
   at System.Windows.Media.VisualTreeHelper.GetParent(DependencyObject reference)
   at Telerik.Windows.Controls.ParentOfTypeExtensions.GetParent(DependencyObject element) in c:\TB\117\WPF_Scrum\Release_WPF_40\Sources\Development\Core\Controls\Extensions\ParentOfTypeExtensions.cs:line 85
   at Telerik.Windows.Controls.ParentOfTypeExtensions.<GetParents>d__0.MoveNext() in c:\TB\117\WPF_Scrum\Release_WPF_40\Sources\Development\Core\Controls\Extensions\ParentOfTypeExtensions.cs:line 77
   at System.Linq.Enumerable.<OfTypeIterator>d__aa`1.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at Telerik.Windows.Controls.ParentOfTypeExtensions.ParentOfType[T](DependencyObject element) in c:\TB\117\WPF_Scrum\Release_WPF_40\Sources\Development\Core\Controls\Extensions\ParentOfTypeExtensions.cs:line 21
   at Telerik.Windows.Controls.ParentOfTypeExtensions.GetParent[T](DependencyObject element) in c:\TB\117\WPF_Scrum\Release_WPF_40\Sources\Development\Core\Controls\Extensions\ParentOfTypeExtensions.cs:line 64
   at Telerik.Windows.Controls.RadTreeView.OnLostFocus(Object sender, RoutedEventArgs e) in c:\TB\117\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\Navigation\TreeView\RadTreeView.cs:line 1437
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.UIElement.OnLostFocus(RoutedEventArgs e)
   at System.Windows.UIElement.IsFocused_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.ClearValueCommon(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata)
   at System.Windows.DependencyObject.ClearValue(DependencyPropertyKey key)
   at System.Windows.Input.FocusManager.OnFocusedElementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at System.Windows.Input.FocusManager.SetFocusedElement(DependencyObject element, IInputElement value)
   at System.Windows.Input.KeyboardNavigation.UpdateFocusedElement(DependencyObject focusTarget)
   at System.Windows.FrameworkContentElement.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
   at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
   at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
   at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
   at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
   at System.Windows.ContentElement.Focus()
   at System.Windows.Documents.Hyperlink.OnMouseLeftButtonDown(Object sender, MouseButtonEventArgs e)
   at System.Windows.Documents.Hyperlink.OnMouseLeftButtonDown(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonDownThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Petar Mladenov
Telerik team
 answered on 21 Nov 2011
1 answer
198 views
Hello!
Is it possible to style ticks to have them inside chart area? 

Best wishes,
Christopher
Giuseppe
Telerik team
 answered on 21 Nov 2011
1 answer
311 views
I have a DataForm that I load via EF. In order to support "Edits", I need to implement the IEditableObject interface but I can't get it to work. I am almost certain I am not the first one trying to do this so if anyone can point me in the right direction would be great.

Thanks in advance.
Ivan Ivanov
Telerik team
 answered on 21 Nov 2011
3 answers
153 views
I just added a style to my app (in appStyles.xaml) to hide the gridview distinct filter. The style is working but in design view of pages & windows i get the following errors:



This is what the resource declarations in the appStyles.xaml are:

 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<br>    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"<br>    xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"<br>    xmlns:Telerik_Windows_Controls_MaskedTextBox="clr-namespace:Telerik.Windows.Controls.MaskedTextBox;assembly=Telerik.Windows.Controls.Input"  >

Here's how i'm the style for the FilteringControl:
    <Style TargetType="{x:Type telerik:FilteringControl}" ><br>        <Setter Property="Template"><br>            <Setter.Value><br>                <ControlTemplate TargetType="{x:Type telerik:FilteringControl}"><br>                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="1" Margin="{TemplateBinding Margin}"><br>                        <Border BorderBrush="White" BorderThickness="1" Background="{TemplateBinding Background}"><br>                            <Grid><br>                                <StackPanel HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" MaxWidth="350" Margin="{TemplateBinding Padding}" MinWidth="200" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"><br>                                    <StackPanel x:Name="PART_DistinctFilter" Visibility="{TemplateBinding DistinctFiltersVisibility}"><br>                                        <CheckBox x:Name="PART_SelectAllCheckBox" Visibility="Collapsed" Content="Select All" IsChecked="{Binding SelectAll, Mode=TwoWay}" Margin="0,2" telerik:LocalizationManager.ResourceKey="GridViewFilterSelectAll"><br>                                            <telerik:StyleManager.Theme><br>                                                <telerik:MetroTheme /><br>                                            </telerik:StyleManager.Theme><br>                                        </CheckBox><br>                                        <ListBox x:Name="PART_DistinctValuesList" ItemsSource="{Binding DistinctValues}" ScrollViewer.HorizontalScrollBarVisibility="Auto" <br>                                                     MaxHeight="100" SelectionMode="Multiple" Visibility="Collapsed" ><br>                                            <ListBox.ItemTemplate><br>                                                <DataTemplate><br>                                                    <CheckBox Content="{Binding ConvertedValue}" IsChecked="{Binding IsActive, Mode=TwoWay}" VerticalContentAlignment="Center"><br>                                                        <telerik:StyleManager.Theme><br>                                                            <telerik:MetroTheme/><br>                                                        </telerik:StyleManager.Theme><br>                                                    </CheckBox><br>                                                </DataTemplate><br>                                            </ListBox.ItemTemplate><br>                                            <telerik:StyleManager.Theme><br>                                                <telerik:MetroTheme/><br>                                            </telerik:StyleManager.Theme><br>                                        </ListBox><br>                                    </StackPanel><br>                                    <StackPanel Margin="0,2" Visibility="{TemplateBinding FieldFiltersVisibility}"><br>                                        <TextBlock Margin="0,2,0,0" telerik:LocalizationManager.ResourceKey="GridViewFilterShowRowsWithValueThat" Text="Show rows with value that"></TextBlock><br>                                        <telerik:RadComboBox x:Name="PART_Filter1ComboBox" ItemsSource="{Binding AvailableActions}" SelectedItem="{Binding Filter1.Operator, Mode=TwoWay}"  Margin="0,2"><br>                                            <telerik:RadComboBox.ItemTemplate><br>                                                <DataTemplate><br>                                                    <TextBlock><br>                                                       <TextBlock.Text><br>                                                        <Binding><br>                                                         <Binding.Converter><br>                                                          <telerik:FilterOperatorConverter/><br>                                                         </Binding.Converter><br>                                                        </Binding><br>                                                       </TextBlock.Text><br>                                                    </TextBlock><br>                                                </DataTemplate><br>                                            </telerik:RadComboBox.ItemTemplate><br>                                            <telerik:StyleManager.Theme><br>                                                <telerik:MetroTheme/><br>                                            </telerik:StyleManager.Theme><br>                                        </telerik:RadComboBox><br>                                        <ContentControl x:Name="PART_Filter1ContentControl" DataContext="{Binding Filter1}" HorizontalContentAlignment="Stretch" Margin="0,2" VerticalContentAlignment="Stretch"/><br>                                        <telerik:RadComboBox x:Name="PART_LogicalOperatorsComboBox"  ItemsSource="{Binding LogicalOperators}" SelectedItem="{Binding FieldFilterLogicalOperator, Mode=TwoWay}" Margin="0,2"><br>                                            <telerik:RadComboBox.ItemTemplate><br>                                                <DataTemplate><br>                                                    <TextBlock><br>                                                       <TextBlock.Text><br>                                                        <Binding><br>                                                         <Binding.Converter><br>                                                          <telerik:FilterCompositionLogicalOperatorConverter/><br>                                                         </Binding.Converter><br>                                                        </Binding><br>                                                       </TextBlock.Text><br>                                                    </TextBlock><br>                                                </DataTemplate><br>                                            </telerik:RadComboBox.ItemTemplate><br>                                            <telerik:StyleManager.Theme><br>                                                <telerik:MetroTheme/><br>                                            </telerik:StyleManager.Theme><br>                                        </telerik:RadComboBox><br>                                        <telerik:RadComboBox x:Name="PART_Filter2ComboBox" ItemsSource="{Binding AvailableActions}"  SelectedItem="{Binding Filter2.Operator, Mode=TwoWay}"  Margin="0,2"><br>                                            <telerik:RadComboBox.ItemTemplate><br>                                                <DataTemplate><br>                                                    <TextBlock><br>                                                       <TextBlock.Text><br>                                                        <Binding><br>                                                         <Binding.Converter><br>                                                          <telerik:FilterOperatorConverter/><br>                                                         </Binding.Converter><br>                                                        </Binding><br>                                                       </TextBlock.Text><br>                                                    </TextBlock><br>                                                </DataTemplate><br>                                            </telerik:RadComboBox.ItemTemplate><br>                                            <telerik:StyleManager.Theme><br>                                                <telerik:MetroTheme/><br>                                            </telerik:StyleManager.Theme><br>                                        </telerik:RadComboBox><br>                                        <ContentControl x:Name="PART_Filter2ContentControl" DataContext="{Binding Filter2}" HorizontalContentAlignment="Stretch" Margin="0,2" VerticalContentAlignment="Stretch"/><br>                                    </StackPanel><br>                                    <Grid><br>                                        <Grid.ColumnDefinitions><br>                                            <ColumnDefinition/><br>                                            <ColumnDefinition/><br>                                        </Grid.ColumnDefinitions><br>                                        <Button x:Name="PART_ApplyFilterButton" Content="Filter" Grid.Column="0" Height="22" Margin="0,2,2,2" telerik:LocalizationManager.ResourceKey="GridViewFilter"><br>                                            <telerik:StyleManager.Theme><br>                                                <telerik:MetroTheme/><br>                                            </telerik:StyleManager.Theme><br>                                        </Button><br>                                        <Button x:Name="PART_ClearFilterButton" Content="Clear Filter" Grid.Column="1" Height="22" Margin="2,2,0,2" telerik:LocalizationManager.ResourceKey="GridViewClearFilter"><br>                                            <telerik:StyleManager.Theme><br>                                                <telerik:MetroTheme/><br>                                            </telerik:StyleManager.Theme><br>                                        </Button><br>                                    </Grid><br>                                </StackPanel><br>                                <telerik:RadButton x:Name="PART_FilterCloseButton" HorizontalAlignment="Right" Height="13" Margin="{TemplateBinding Padding}" VerticalAlignment="Top" Width="13"><br>                                    <telerik:StyleManager.Theme><br>                                        <telerik:MetroTheme/><br>                                    </telerik:StyleManager.Theme><br>                                    <Path Data="M4,4L5,4 5,5 4,5z M0,4L1,4 1,5 0,5z M3,3L4,3 4,4 3,4z M1,3L2,3 2,4 1,4z M2,2L3,2 3,3 2,3z M4,0L5,0 5,1 4,1 4,2 3,2 3,0.99999994 4,0.99999994z M0,0L1,0 1,0.99999994 2,0.99999994 2,2 1,2 1,1 0,1z" Fill="Black" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Height="6" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="6"/><br>                                </telerik:RadButton><br>                            </Grid><br>                        </Border><br>                    </Border><br>                </ControlTemplate><br>            </Setter.Value><br>        </Setter><br>        <Setter Property="Background" Value="#FFE4E4E4"/><br>        <Setter Property="BorderBrush" Value="#FF848484"/><br>        <Setter Property="Padding" Value="5"/><br>        <Setter Property="Margin" Value="0,2,0,0"/><br>        <Setter Property="BorderThickness" Value="1"/><br>        <Setter Property="VerticalContentAlignment" Value="Stretch"/><br>        <Setter Property="HorizontalContentAlignment" Value="Stretch"/><br>        <Setter Property="Foreground" Value="Black"/><br>        <Setter Property="SnapsToDevicePixels" Value="True"/><br>    </Style>

Here's from a window:
<Window x:Class="RawDataView" <br>    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<br>    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<br>    Title="Raw Data View" Height="437" Width="658" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" WindowStartupLocation="CenterOwner"><br><br>    <Window.Resources><br>            <ResourceDictionary><br>                <!--Set this here due to Telerik bug, so header cell and row colors match--><br>                <Style x:Key="headerRow" TargetType="telerik:GridViewHeaderRow"><br>                    <Setter Property="Background" Value="#FFF5F5FD"/><br>                </Style><br>            <!-- Import our app styles --><br>            <ResourceDictionary.MergedDictionaries><br>                <ResourceDictionary Source="/app.Styles.xaml" /><br>            </ResourceDictionary.MergedDictionaries><br>        </ResourceDictionary><br>    </Window.Resources>

Not sure if i need to qualify the FilteringControl style with something or add another xmlns reference to the styles. Thanks

Vanya Pavlova
Telerik team
 answered on 21 Nov 2011
1 answer
110 views
Hi there,

is it possible to use a WPF MapControl in a Winforms-Application?
We have a WinForms-Application where we want to use some Map.
Or any other idea?

Best Regards
Manfred
Andrey
Telerik team
 answered on 21 Nov 2011
3 answers
148 views

Hi,


I have radcombobox which is

IsEditable="True" 
IsTextSearchEnabled="True" 
TextSearchMode="StartsWith"

 
Now when user enters some text which is not present in the list that is binded to the radcombobox and the radcombobox loses focus, i want a alert which tells users that value entered is not available and clears the text entered in the radcombobox.

Please guide.

 

Yana
Telerik team
 answered on 21 Nov 2011
5 answers
198 views
Hello,
I read many post in this forum, but still not have answer.

How to apply current telerik theme to TextBox?
So no hardcoded theme but current theme.

We have function like this:
internal static void ApplyConfiguredTheme()
       {
           switch (GetConfiguredTheme())
           {
               case ThemeEnum.Black:
                   StyleManager.ApplicationTheme = new Office_BlackTheme();
                   break;
               case ThemeEnum.Blue:
                   StyleManager.ApplicationTheme = new Office_BlueTheme();
                   break;
               case ThemeEnum.Silver:
                   StyleManager.ApplicationTheme = new Office_SilverTheme();
                   break;
               case ThemeEnum.Win7:
                   StyleManager.ApplicationTheme = new Windows7Theme();
                   break;
           }
       }

So in XAML I cant hardcode any theme.

Jaroslav Půbal
Top achievements
Rank 1
 answered on 21 Nov 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?