Windows8 theme minimize button

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

    Posted 09 Apr 2013 Link to this post

    Hi,

    Could you make the TileView Windows8 theme mimimize button taller?

    At the moment the minimze button is 2 pixels high which makes it hard to click on.

    For other themes (office black for example) the image is small too, but there it has transparent rows above and below so it allows you to click on the button easier.

    The dash itself could be thicker too, maybe 6 pixels high, and then 5 transparent pixel rows above and below to give a 16 height total.

    Also see your demos for what I mean:

    http://demos.telerik.com/silverlight/#TileView/Theming

    Then select Windows 8 theme and click the maximize / minimize.

    Also, for the Windows8 Touch theme the maximize / minimize buttons have the same icon.

    Regards,

    Bayram
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 12 Apr 2013 Link to this post

    Hello Bayram,

    In your case you can extract and edit the default template of the RadTileView control. For more information you can take a look at this article. For your convenience I edited (in the attached project) the default template of the control.

    In order to achieve the layout I changed the Height property (from 5 to 10 pixels) of the Grid called "Collapse", placed in the ControlTemplate targeting RadToggleButton.

    Please take a look at the attached project and let me know if it works for you.

    Kind regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. B
    B avatar
    74 posts
    Member since:
    Jul 2011

    Posted 17 Apr 2013 Link to this post

    Hi,

    Unfortunately this doesnt work to well in my case, I support multiple themes via:

    Telerik.Windows.Controls.StyleManager.ApplicationTheme


    For example, for the black theme I want to keep the button as it is.

    I could make the changes directly in the theme sources of course. I did that before, but that means with every Telerik update I have to keep merging the changes. For 1 change it may not be a big deal, but there are more changes I would like to apply. Also when branching versions or going back/forward to another release of my application would be more error prone.

    It would be ideal if it was possible to somehow patch themes when they are loaded.

    Regards,

    Bayram
  5. B
    B avatar
    74 posts
    Member since:
    Jul 2011

    Posted 18 Apr 2013 Link to this post

    Hi,

     

    To hopefully make the issue I'm facing clearer, here is a description of the process that is currently involved when upgrading to a new Telerik version.

    Although it works, that is: the resulting application looks and acts the way I want it to perfectly, it is a very time consuming and error prone process. If there is any way to improve the efficiency of this process and make it less errorprone I would be very grateful.

     

    Styles is not the answer: they can't be adapted in a theme agnostic way. That is: if I give a control some style it will automatically become some theme, which might be different from the application theme.

     

    These steps have to be done once (this is not a problem just to illustrate the proces):

    1. Copy the RadControls\Themes.Implicit folder to a separate TFS project. This is where I keep track of my changes to Themes
    2. Make localization groups for Dutch/English

    These steps have to be repeated for every Telerik release I upgrade to when I want to make a theme wide change:

    1. Open the Visual Studio solution in Themes.Implicit
    2. In each subfolder (OfficeBlack/Themes, Windows8Touch/Themes, etc.) open the file Telerik.Windows.Controls.Data.xaml
    3. Do a file compare/merge with my own version of the file (*). If the file differs too much due to reformatting, I have to reapply the changes manually, so I add "Genetics" tags just in case.
    4. Build the solution with debug mode
    5. Copy all the dll's and pdb:
      1. from: RadControls\Themes.Implicit\Windows8Touch\Bin\Debug\Telerik.Windows.Themes.Windows8Touch.dll
      2. to: RadControls\Binaries\Silverlight
      3. and do this for all themes (OfficeBlack, Windows8Touch, etc)
    6. Close the Themes.Implicit solution and open the PowerBrowser project
    7. Do Build/Clean Solution, Build/Build solution
    8. Test every component, and repeat steps 1 to 7 if necesary.
    9. If everything works, check out all the TFS files in my version of RadControls\Themes.Implicit for Edit, copy the merged Telerik version over them, Check in the changes.

    (*) Example of a theme wide change, to add rowcount to RadDataPager

        <!-- Genetics Extension start -->
                        <StackPanel Orientation="Horizontal" Margin="5"  Height="Auto" Width="Auto">
                            <TextBlock telerik:LocalizationManager.ResourceKey="Genetics_RadDataPager_NumberRows" FontSize="{TemplateBinding FontSize}"/>
                            <TextBlock Text="{Binding TotalItems, StringFormat=' {0}', Mode=TwoWay}"/>
                        </StackPanel>
        <!-- Genetics Extension end -->

     

     

    This part only has to be done once (for each language):

     

    #region Genetics Telerik Theme Extensions

    case "Genetics_RadDataPager_NumberRows": return "Aantal rijen";

    #endregion Genetics Telerik Theme Extensions

  6. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 22 Apr 2013 Link to this post

    Hi Bayram,

    In order to change the default look of our controls you can use one of these approaches. The first is to use Styles (which you do not want to do) and the second approach is to change the default style in code behind. In order to do that you first have to make sure that the items are already generated. The best way to is to use the ItemContainerGenerator and subscribe to its StatusChanged event and check the state of the items in the handler. Furthermore, you will have to traverse the visual tree and find the same Grid and customize it. In this case you will have to change only the Height property.

    For your convenience we implemented this approach in the attached project. Please take a look at it and let me know if it works for you.

    Kind regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. B
    B avatar
    74 posts
    Member since:
    Jul 2011

    Posted 22 Apr 2013 Link to this post

    Hi Pavel,

    Thank you for your answer, but changing the default style is not what I am after. What I am trying to do is looking for a good way to make changes/fix bugs to multiple user selectable Themes. Preferably as a separate project so I can reuse it for other applications without having to change xaml/C# files in the main application's sources.

    A user selectable theme could be the default theme in which case your suggestion would work, but what if the user has selected another theme? Applying an OfficeBlack change to a Windows8 theme would look strange. Of course you could have switches, but this doesnt sound like a good approach.

    What I am looking for is a way to derive from existing base themes.

    But I realize that there probably is nothing like that and the best practice is probably what I am doing atm: I make custom themes based on the original themes by copy/pasting all the files and change them/fix bugs where necesary. So I will use this approach.

    Regards,

    Bayram
  8. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 25 Apr 2013 Link to this post

    Hi Bayram,

    You can try out our implicit styles (read more). By following the approach described in the article, you will be able to customize a desired theme (or maybe all of them) and share the changes over your application. Please note that you will have to change our XAML only once (in one file) and you will be able to do this with all themes that you want to support.

    Furthermore, this approach will allow you to switch themes at runtime (read more) by merging dictionaries. One you have customized our themes you will be able to collect all files in a class library and share it.

    Please try these approaches out and let us know if your need further assistance.

    Regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner