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

Visual Studio 2013 Dark Theme and ContextMenu

5 Answers 259 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 08 Sep 2015, 06:56 PM

I am using the Visual Studio 2013 Dark Theme (using Implicit styles) and for the most part everything looks great out of the box.  One issue that I have run across is that the Context Menu that shows up for a TextBox (Cut, Copy, Paste) is not themed at all.  Additionally, using the RadRibbonWindow, when clicking on the Icon, the Context Menu that shows up (Restore, Move, Size, Minimize, Maximize, Close) is not themed at all.  I have to think that I am missing a setting somewhere for these to be themed but I cannot find it anywhere.  

 Can you help me out?

 

Jon

5 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 09 Sep 2015, 07:58 AM
Hi Jon,

Thank you for contacting us.

Can please share some more details and screenshots regarding the issue? Are the ResourceDictionaries merged in App.xaml? Can you provide some sample code demonstrating the issue, so we can try to reproduce it on our side?

I'm looking forward to hearing from you.

Regards,
Kalin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jon
Top achievements
Rank 1
answered on 09 Sep 2015, 02:32 PM
Thanks Kalin.  I attached a PowerPoint showing a quick way to reproduce the issue using the Outlook Inspired template and a screenshot of the issue.  Change file extension from .jpg to .zip
0
Kalin
Telerik team
answered on 10 Sep 2015, 08:30 AM
Hello Jon,

The ContextMenu doesn't change because this is the native WPF ContextMenu that shows on right click on a TextBox. In order to have themed ContextMenu with the current theme you would need to replace it with RadContextMenu. In order to do so you would need to do the following:

<telerik:RadWatermarkTextBox ContextMenu={x:Null}>
    <telerik:RadContextMenu.ContextMenu>
          <telerik:RadContextMenu>
                <telerik:RadMenuItem Header="Copy" />
                <telerik:RadMenuItem Header="Paste" />
                <telerik:RadMenuItem Header="Cut" />
         </telerik:RadContextMenu>
    </telerik:RadContextMenu.ContextMenu>
</telerik:RadWatermarkTextBox>

We will consider replacing the regular ContextMenu with RadContextMenu in the Outlook-Insipired Template.

Hope this helps.

Regards,
Kalin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jon
Top achievements
Rank 1
answered on 10 Sep 2015, 02:19 PM

Maybe I am missing where you suggest applying the snippet, but it didn't work in the outlook inspired app in the sample below.  I know I can get this to work by setting this in the default style for TextBox, Watermark TextBox,etc. but it was what I was trying to avoid using a third party theme.  Since the dark theme is unusable until this is fixed, do you have any recommendations for theming so I can keep the Resource Dictionaries you provide untouched (so I don't run into issues when updating Telerik) and make sure I am not missing something that users will find.  For example, the ContextMenu (Restore, Move, Size, Minimize, Maximize, Close) for the RadRibbonWindow Icon has the same problem.

<telerik:RadWatermarkTextBox x:Name="SearchWatermarkTextBox" WatermarkContent="Search Current Mailbox" ContextMenu="{x:Null}">
     <telerik:RadContextMenu.ContextMenu>
        <telerik:RadContextMenu>
           <telerik:RadMenuItem Header="Copy" />
           <telerik:RadMenuItem Header="Paste" />
           <telerik:RadMenuItem Header="Cut" />
        </telerik:RadContextMenu>
    </telerik:RadContextMenu.ContextMenu>
</telerik:RadWatermarkTextBox>​

0
Evgenia
Telerik team
answered on 11 Sep 2015, 02:54 PM
Hi Jon,

The snippet my colleague Kalin sent is working in a standalone application where the RadWaterMarkTextBox control is positioned directly within a Grid.
However when you run the OutllokInspired template (with the code snippet he mentioned applied) and right-click the RadWatermarkTextBox you will see that the RadContextMenu appears only when you have clicked in the area outside the TextBox. As you know the TextBox itself provides its own context menu by default -- the MS Conetxt Menu which is not styled by our theming mechanismns and therefore appears White. So right-click on the TextBox inside the RadWaterMark control and the MS ContextMenu gets shown. So why is this happening:
As you know setting the ContextMenu property of any FrameworkElement to x:Null disabled displaying it. If you look carefully at the xaml structure of the OutlookInspired project you will see that  the RadWatermarkTextBox control is inside DataTemplate with x:key MailViewMainSectorTemplate. When you set the ContextMenu property inside a datatemplate, you're not actually setting a local value; you're setting a "TemplatedParent  template" value. If you look at the dependency properties precedence list you will see that your setting therefore has lower priority. To prove this you might inspect the value with DependencyPropertyHelper.GetValueSource() and you'll see the base value source is ParentTemplate instead of Local. So how to set a local value -- I suggest that you create new attached dependency property "IsContextMenuDisabled" of type Boolean and set the ContextMenu property of the control to Null explicitly wherever your attached property value is True. Now apply the attached property in xaml on the TextBox and set it to True. 
I attached a small sample that demonstrates the attached dependency property approach. Let me know how it works for you.

As for the RibbonWindow ContextMenu -- I'm not sure that I understand your question. Do you try to apply our context menu on it as well? The one you see is the default Windows OS contextmenu that gets applied on every window generated by Windows Explorer (see attached image).

Regards,
Evgenia
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Jon
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Jon
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or