Click here to Skip to main content
15,867,308 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Referencing DrawingImage in a binding. Pin
Maximilien5-Oct-22 7:55
Maximilien5-Oct-22 7:55 
QuestionDesign Question Pin
Kevin Marois2-Oct-22 11:13
professionalKevin Marois2-Oct-22 11:13 
AnswerRe: Design Question Pin
Gerry Schmitz2-Oct-22 15:47
mveGerry Schmitz2-Oct-22 15:47 
QuestionLooking for a WPF control. Pin
Maximilien22-Sep-22 8:40
Maximilien22-Sep-22 8:40 
AnswerRe: Looking for a WPF control. Pin
Richard Deeming22-Sep-22 21:39
mveRichard Deeming22-Sep-22 21:39 
GeneralRe: Looking for a WPF control. Pin
Maximilien23-Sep-22 1:33
Maximilien23-Sep-22 1:33 
GeneralRe: Looking for a WPF control. Pin
Maximilien23-Sep-22 1:54
Maximilien23-Sep-22 1:54 
QuestionWeird behavior with contextual menu not rendering properly. Pin
Maximilien21-Sep-22 7:00
Maximilien21-Sep-22 7:00 
I have a button with a contextual menu attached to it, I want display the menu on the left click instead of the default right click.

I'm using a company wide "resource pack" that defines some style.

When I left click on the button to open the menu, the menu is drawn/rendered using the default windows style and the event/commands are not triggered.
When I right click on the button to open the menu, the menu is drawn/rendered using our styles and events/commands are working.
When I left click again the menu is drawn/rendered using our styles and event/commands are working

I'm not sure why the wrong menu is loaded once.

Any insights or things I might have missed ?
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MyCompany.Presentation;component/Themes/MyCompany.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
<!-- ... -->
           <Button Content="Right-Click Me!" Click="ButtonBase_OnClick">
                <Button.ContextMenu>
                <ContextMenu x:Name="MyContextMenu">
                    <MenuItem Header="a" IsCheckable="True" Command="{Binding DoACommand}" IsChecked="{Binding IsAChecked, Mode=OneWay}"/>
                    <MenuItem Header="b" IsCheckable="True" Command="{Binding DoBCommand}" IsChecked="{Binding IsBChecked, Mode=OneWay}"/>
                    </ContextMenu>
                </Button.ContextMenu>
            </Button>
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
    if (MyContextMenu.ContextMenu != null)
        MyContextMenu.ContextMenu.IsOpen = true;
}
CI/CD = Continuous Impediment/Continuous Despair

AnswerRe: Weird behavior with contextual menu not rendering properly. Pin
Richard Deeming21-Sep-22 21:36
mveRichard Deeming21-Sep-22 21:36 
GeneralRe: Weird behavior with contextual menu not rendering properly. Pin
Maximilien22-Sep-22 8:22
Maximilien22-Sep-22 8:22 
QuestionConversion to .Net Core Issues Pin
Kevin Marois19-Sep-22 6:39
professionalKevin Marois19-Sep-22 6:39 
AnswerRe: Conversion to .Net Core Issues Pin
Richard Deeming19-Sep-22 21:20
mveRichard Deeming19-Sep-22 21:20 
GeneralRe: Conversion to .Net Core Issues Pin
Kevin Marois20-Sep-22 7:10
professionalKevin Marois20-Sep-22 7:10 
GeneralRe: Conversion to .Net Core Issues Pin
Kevin Marois22-Sep-22 5:57
professionalKevin Marois22-Sep-22 5:57 
GeneralRe: Conversion to .Net Core Issues Pin
Richard Deeming22-Sep-22 21:38
mveRichard Deeming22-Sep-22 21:38 
QuestionUsing Dependency Property's to Affect Non WPF Property's Pin
Marc Jeeves1-Sep-22 10:52
Marc Jeeves1-Sep-22 10:52 
AnswerRe: Using Dependency Property's to Affect Non WPF Property's Pin
Richard Deeming1-Sep-22 22:11
mveRichard Deeming1-Sep-22 22:11 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Marc Jeeves2-Sep-22 4:11
Marc Jeeves2-Sep-22 4:11 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Richard MacCutchan3-Sep-22 21:01
mveRichard MacCutchan3-Sep-22 21:01 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
mjeeves3-Sep-22 8:58
mjeeves3-Sep-22 8:58 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Gerry Schmitz4-Sep-22 8:57
mveGerry Schmitz4-Sep-22 8:57 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Richard Deeming5-Sep-22 21:11
mveRichard Deeming5-Sep-22 21:11 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Gerry Schmitz6-Sep-22 5:34
mveGerry Schmitz6-Sep-22 5:34 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Marc Jeeves6-Sep-22 10:05
Marc Jeeves6-Sep-22 10:05 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Gerry Schmitz6-Sep-22 13:19
mveGerry Schmitz6-Sep-22 13:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.