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

Office 2013 theme TextBoxStyle is defined 4 times

3 Answers 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
B
Top achievements
Rank 2
B asked on 26 Jun 2014, 11:41 AM
Hi,

In the Office 2013 theme there are 4 definitions of TextBoxStyle, but these are exactly the same. I dont see the reason behind doing that?

I stumbled across this when I wanted to make some changes to TextBoxStyle (readonly not removing the border) and nothing happened.

I currently fixed it for my application with the code below, but I don't know if that is what you intended. Could you look into this?

<!-- Add this to all files where TextBoxStyle is defined except for System.Windows.xaml -->
<ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="System.Windows.xaml" />
</ResourceDictionary.MergedDictionaries>
 
<!-- Remove these from all files except System.Windows.xaml -->
<Style x:Key="TextBoxStyle" TargetType="TextBox">
<Style TargetType="TextBox" BasedOn="{StaticResource TextBoxStyle}" />


Regards,

Bayram

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 27 Jun 2014, 12:16 PM
Hi B Demir,



Thank you for contacting us.


The behavior you described is intentional and not specific to Office2013 theme.
You are referring to helper styles, that are used across the theme assemblies. The resource scope of these styles is per assembly and by that reason they are merged in the corresponding resource dictionary for all themes. 


For example: RadDataPager  uses DataPagerTextBox, which is designed to serve specific functionality to RadDataPager, however it doesn't require appearance different than the default one.
By that reason we merged the TextBox style in Telerik.Windows.Controls.Data.xaml.


Would it be possible to point us to the problematic styles, that could be a show-stopper for you in Office2013?


I look forward to hearing from you.


Regards,
Vanya Pavlova
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
B
Top achievements
Rank 2
answered on 27 Jun 2014, 02:45 PM
Hi Vanya,

Here is the list of fixes I apply:
- System.Windows.xaml, I remove the line:
<Style BasedOn="{StaticResource ScrollViewerStyle}" TargetType="ScrollViewer" />
- System.Windows.xaml, TextBoxStyle,  I remove the ReadOnly Storyboard and the Background="Transparent" in the ScrollViewer ContentElement
- Telerik.Windwos.Controls.Data.xaml, I remove the TextBoxStyle and merge System.Windows.xaml resource dictionary instead
- Telerik.Windwos.Controls.Diagrams.Extensions.xaml, I remove the TextBoxStyle and merge System.Windows.xaml resource dictionary instead
- Telerik.Windows.Controls.Input.xaml, RadMaskedInputBase, I remove the ReadOnly Storyboard
- Telerik.Windwos.Controls.Navigation.xaml, I remove the TextBoxStyle and merge System.Windows.xaml resource dictionary instead

So there are two groups of fixes:
- the border disappearing when the control is ReadOnly (this might be intentional, but my customers want to see the border).
- the scrollviewer fix is needed for an obscure bug that makes usercontrol content take up about 10000 pixels, but this only happens in the RadOutlookBar inside a RadDockingPane that is left aligned in combination with RadExpander,

Don't think you want to apply either fix in your version, but what would make life easier for me is if I only had to apply the fix once instead of 4 times for each definition of RadTextBoxStyle. That would be possible if you merged the System.Windows.xaml dictionary instead of copy/pasting the style.

Regards,

Bayram
0
Sia
Telerik team
answered on 01 Jul 2014, 02:15 PM
Hello Bayram,

As you already pointed, we duplicate XAML in the outputed files since we base some style from one assembly on style from another one. If you have customized the TextBox style from System.Windows.xaml file and merge after it  the implicit styles for Telerik.Windows.Controls.Data.xaml, you will have your custom style overwritten by the default one which is outputted in Telerik.Windows.Controls.Data.xaml file. 

You have two options
  •  to avoid duplicate XAML in  Telerik.Windows.Controls.Data.xaml:
    • delete the duplicate XAML directly in the generated file (Telerik.Windows.Controls.Data.xaml) and merge System.Windows.xaml there as you did.
    • update the ouput for Telerik.Windows.Controls.Data.xaml by using the Telerik.Windows.Controls.Data_x.xaml file from our source code. You need to update the TextBox style and after that build the Themes.Sources project.
  • to change the TextBox style in both .xaml files (which unfortunately is more difficult to maintain and we would not recommend).

The suggested approach cannot work with our current preprocessing mechanism because we distribute already merged dictionaries, but we understand your problems and will discuss it internally.

Please let us know whether this helps.

Regards,
Sia
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
General Discussions
Asked by
B
Top achievements
Rank 2
Answers by
Vanya Pavlova
Telerik team
B
Top achievements
Rank 2
Sia
Telerik team
Share this question
or