Click here to Skip to main content
15,170,343 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Executing a WPF .exe program from an email link Pin
Richard Deeming5-Aug-16 9:26
mveRichard Deeming5-Aug-16 9:26 
AnswerRe: Executing a WPF .exe program from an email link Pin
holdorf5-Aug-16 10:40
Memberholdorf5-Aug-16 10:40 
GeneralRe: Executing a WPF .exe program from an email link Pin
Dave Kreskowiak5-Aug-16 10:45
mveDave Kreskowiak5-Aug-16 10:45 
AnswerRe: Executing a WPF .exe program from an email link Pin
Richard MacCutchan5-Aug-16 21:42
mveRichard MacCutchan5-Aug-16 21:42 
AnswerRe: Executing a WPF .exe program from an email link Pin
Gerry Schmitz6-Aug-16 8:07
mveGerry Schmitz6-Aug-16 8:07 
GeneralRe: Executing a WPF .exe program from an email link Pin
holdorf7-Aug-16 12:26
Memberholdorf7-Aug-16 12:26 
GeneralRe: Executing a WPF .exe program from an email link Pin
Gerry Schmitz7-Aug-16 13:16
mveGerry Schmitz7-Aug-16 13:16 
QuestionResourceDictionary swapped at run-time only applies to MainWindow Pin
James A. Young5-Aug-16 7:51
MemberJames A. Young5-Aug-16 7:51 
I have a class that derives from Window and I use it for ALL windows in my application. I have a resource dictionary for themes contained in App.xaml, which looks like this:
<Application [...]>
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary x:Name="ThemeDictionary">
                    <ResourceDictionary.MergedDictionaries>
                        <ResourceDictionary Source="/Themes/MyTheme.xaml"/>
                    </ResourceDictionary.MergedDictionaries>
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
    [...]
</Application>

The style for my derived window type is located in an external assembly and declared using Generic/Themes.xaml pattern.

For switching the theme, I remove the existing theme dictionary and replace it with the new one. Oddly, the changes in styles only reflect in MainWindow and not in any additionally created windows.

My derived window type is styled like this:
<ControlTemplate x:Key="WindowTemplate" TargetType="{x:Type Controls:CustomWindow}">
    [...]
</ControlTemplate>
<Style x:Key="{x:Type Controls:CustomWindow}" TargetType="{x:Type Controls:CustomWindow}" BasedOn="{StaticResource CustomWindowStyle}">
    [...]
</Style>

Note, the theme specified at design-time always works in ALL windows; however, any themes specified at run-time only apply to MainWindow and never additional windows.

Any idea why this is?
AnswerRe: ResourceDictionary swapped at run-time only applies to MainWindow Pin
Richard Deeming5-Aug-16 8:02
mveRichard Deeming5-Aug-16 8:02 
GeneralRe: ResourceDictionary swapped at run-time only applies to MainWindow Pin
James A. Young5-Aug-16 8:18
MemberJames A. Young5-Aug-16 8:18 
QuestionKeepTextBoxDisplaySynchronizedWithTextProperty Pin
Kevin Marois28-Jul-16 8:18
professionalKevin Marois28-Jul-16 8:18 
AnswerRe: KeepTextBoxDisplaySynchronizedWithTextProperty Pin
Matt T Heffron28-Jul-16 8:33
professionalMatt T Heffron28-Jul-16 8:33 
GeneralRe: KeepTextBoxDisplaySynchronizedWithTextProperty Pin
Kevin Marois28-Jul-16 8:39
professionalKevin Marois28-Jul-16 8:39 
QuestionCreating a line break to keep visible tabitems from wrapping when other tabitems become visible. Pin
holdorf28-Jul-16 4:16
Memberholdorf28-Jul-16 4:16 
AnswerRe: Creating a line break to keep visible tabitems from wrapping when other tabitems become visible. Pin
holdorf28-Jul-16 15:41
Memberholdorf28-Jul-16 15:41 
QuestionDP not Working Pin
Kevin Marois27-Jul-16 9:01
professionalKevin Marois27-Jul-16 9:01 
AnswerRe: DP not Working Pin
Gerry Schmitz27-Jul-16 16:44
mveGerry Schmitz27-Jul-16 16:44 
GeneralRe: DP not Working Pin
Kevin Marois27-Jul-16 17:38
professionalKevin Marois27-Jul-16 17:38 
AnswerRe: DP not Working Pin
PureNsanity28-Jul-16 13:50
professionalPureNsanity28-Jul-16 13:50 
GeneralRe: DP not Working Pin
Kevin Marois28-Jul-16 14:29
professionalKevin Marois28-Jul-16 14:29 
GeneralRe: DP not Working Pin
PureNsanity28-Jul-16 14:51
professionalPureNsanity28-Jul-16 14:51 
GeneralRe: DP not Working Pin
Kevin Marois28-Jul-16 15:14
professionalKevin Marois28-Jul-16 15:14 
SuggestionRe: DP not Working Pin
Richard Deeming29-Jul-16 3:11
mveRichard Deeming29-Jul-16 3:11 
GeneralRe: DP not Working Pin
Richard Deeming29-Jul-16 3:12
mveRichard Deeming29-Jul-16 3:12 
GeneralRe: DP not Working Pin
PureNsanity29-Jul-16 4:47
professionalPureNsanity29-Jul-16 4:47 

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.