Office 2013 theme TextBoxStyle is defined 4 times

4 posts, 0 answers
  1. B
    B avatar
    74 posts
    Member since:
    Jul 2011

    Posted 26 Jun 2014 Link to this post

    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
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 27 Jun 2014 Link to this post

    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.
     
  3. DevCraft banner
  4. B
    B avatar
    74 posts
    Member since:
    Jul 2011

    Posted 27 Jun 2014 in reply to Vanya Pavlova Link to this post

    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
  5. Sia
    Admin
    Sia avatar
    667 posts

    Posted 01 Jul 2014 Link to this post

    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.
     
Back to Top