Click here to Skip to main content
15,917,709 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Basic WPF binding to collection in combobox. Pin
Pete O'Hanlon10-Aug-16 12:20
mvePete O'Hanlon10-Aug-16 12:20 
GeneralRe: Basic WPF binding to collection in combobox. Pin
wind te10-Aug-16 18:41
wind te10-Aug-16 18:41 
GeneralRe: Basic WPF binding to collection in combobox. Pin
Pete O'Hanlon10-Aug-16 21:21
mvePete O'Hanlon10-Aug-16 21:21 
GeneralRe: Basic WPF binding to collection in combobox. Pin
Mycroft Holmes10-Aug-16 17:01
professionalMycroft Holmes10-Aug-16 17:01 
Questionwpf gridview does not have a row selected event Pin
Stephen Holdorf9-Aug-16 4:26
Stephen Holdorf9-Aug-16 4:26 
AnswerRe: wpf gridview does not have a row selected event Pin
Richard Deeming9-Aug-16 5:10
mveRichard Deeming9-Aug-16 5:10 
GeneralRe: wpf gridview does not have a row selected event Pin
Stephen Holdorf9-Aug-16 9:57
Stephen Holdorf9-Aug-16 9:57 
GeneralRe: wpf gridview does not have a row selected event Pin
Richard Deeming9-Aug-16 10:09
mveRichard Deeming9-Aug-16 10:09 
GeneralRe: wpf gridview does not have a row selected event Pin
Stephen Holdorf10-Aug-16 2:24
Stephen Holdorf10-Aug-16 2:24 
QuestionCopy directory with progress bar in WPF Pin
Dadou557-Aug-16 20:12
Dadou557-Aug-16 20:12 
AnswerRe: Copy directory with progress bar in WPF Pin
Richard MacCutchan7-Aug-16 21:14
mveRichard MacCutchan7-Aug-16 21:14 
GeneralRe: Copy directory with progress bar in WPF Pin
Dadou557-Aug-16 21:50
Dadou557-Aug-16 21:50 
GeneralRe: Copy directory with progress bar in WPF Pin
Pete O'Hanlon7-Aug-16 22:06
mvePete O'Hanlon7-Aug-16 22:06 
GeneralRe: Copy directory with progress bar in WPF Pin
Dadou557-Aug-16 22:38
Dadou557-Aug-16 22:38 
GeneralRe: Copy directory with progress bar in WPF Pin
Pete O'Hanlon7-Aug-16 22:46
mvePete O'Hanlon7-Aug-16 22:46 
QuestionExecuting a WPF .exe program from an email link Pin
Stephen Holdorf5-Aug-16 8:07
Stephen Holdorf5-Aug-16 8:07 
AnswerRe: Executing a WPF .exe program from an email link Pin
Richard Deeming5-Aug-16 8:26
mveRichard Deeming5-Aug-16 8:26 
AnswerRe: Executing a WPF .exe program from an email link Pin
Stephen Holdorf5-Aug-16 9:40
Stephen Holdorf5-Aug-16 9:40 
GeneralRe: Executing a WPF .exe program from an email link Pin
Dave Kreskowiak5-Aug-16 9:45
mveDave Kreskowiak5-Aug-16 9:45 
AnswerRe: Executing a WPF .exe program from an email link Pin
Richard MacCutchan5-Aug-16 20:42
mveRichard MacCutchan5-Aug-16 20:42 
AnswerRe: Executing a WPF .exe program from an email link Pin
Gerry Schmitz6-Aug-16 7:07
mveGerry Schmitz6-Aug-16 7:07 
GeneralRe: Executing a WPF .exe program from an email link Pin
Stephen Holdorf7-Aug-16 11:26
Stephen Holdorf7-Aug-16 11:26 
GeneralRe: Executing a WPF .exe program from an email link Pin
Gerry Schmitz7-Aug-16 12:16
mveGerry Schmitz7-Aug-16 12:16 
QuestionResourceDictionary swapped at run-time only applies to MainWindow Pin
Imagiv5-Aug-16 6:51
Imagiv5-Aug-16 6: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 7:02
mveRichard Deeming5-Aug-16 7:02 

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.