Click here to Skip to main content
15,918,889 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Set size for all "Window" in project at runtime Pin
Errorrist13-Apr-12 8:35
Errorrist13-Apr-12 8:35 
Ok, it kinda works. But there are some points and questions in the code:


C#
public MainWindow()
        {
            InitializeComponent();

            using (FileStream fs = new FileStream(@"C:\projekte\MyButtonStyle.xaml", FileMode.Open))
            {
                ResourceDictionary rd = (ResourceDictionary)XamlReader.Load(fs);
                this.Resources = rd;
            }

            //THIS WORKS FINE PRETTY WELL


            //But now I want to try this:

            var style = new Style();
            style = ((Style)Resources["myFunctionButtonStyle"]);


            var styleClone = new Style();
            foreach (var setter in style.Setters)
            {
                var typedSetter = setter as Setter;
                if (typedSetter != null)
                {
                    var newSetter = new Setter(typedSetter.Property, typedSetter.Value);
                    styleClone.Setters.Add(newSetter);
                }
            }

            styleClone.Setters.Add(new Setter { Property = Button.FontSizeProperty, Value = (double)111 });

            //until here it works pretty well!
            //Now, how can I add this style to the Resources??? I mean, you showed me how to include xaml-files. but how is 
            // with pure Styles?????
            this.Resources.Add(      )

        }

Questioninsert data from excel file into datagrid Pin
MemberDotNetting12-Apr-12 23:23
MemberDotNetting12-Apr-12 23:23 
QuestionRe: insert data from excel file into datagrid Pin
Richard MacCutchan13-Apr-12 0:18
mveRichard MacCutchan13-Apr-12 0:18 
AnswerRe: insert data from excel file into datagrid Pin
MemberDotNetting13-Apr-12 1:45
MemberDotNetting13-Apr-12 1:45 
GeneralRe: insert data from excel file into datagrid Pin
Richard MacCutchan13-Apr-12 2:52
mveRichard MacCutchan13-Apr-12 2:52 
GeneralRe: insert data from excel file into datagrid Pin
MemberDotNetting13-Apr-12 4:28
MemberDotNetting13-Apr-12 4:28 
AnswerRe: insert data from excel file into datagrid Pin
Bernhard Hiller13-Apr-12 0:31
Bernhard Hiller13-Apr-12 0:31 
GeneralRe: insert data from excel file into datagrid Pin
MemberDotNetting13-Apr-12 1:45
MemberDotNetting13-Apr-12 1:45 
Questiondatagrid collection Pin
michaelgr111-Apr-12 8:53
michaelgr111-Apr-12 8:53 
QuestionBinding TextBox to DataGrid - WPF C# Pin
Sutton Mehaffey11-Apr-12 7:04
Sutton Mehaffey11-Apr-12 7:04 
QuestionTimer Pin
pix_programmer10-Apr-12 6:40
pix_programmer10-Apr-12 6:40 
AnswerRe: Timer Pin
Mycroft Holmes10-Apr-12 13:07
professionalMycroft Holmes10-Apr-12 13:07 
GeneralRe: Timer Pin
Pete O'Hanlon10-Apr-12 20:27
mvePete O'Hanlon10-Apr-12 20:27 
GeneralRe: Timer Pin
Mycroft Holmes10-Apr-12 20:48
professionalMycroft Holmes10-Apr-12 20:48 
AnswerRe: Timer Pin
Andy41111-Apr-12 2:37
Andy41111-Apr-12 2:37 
QuestionAnother WPF Styling Question Pin
Kevin Marois10-Apr-12 6:02
professionalKevin Marois10-Apr-12 6:02 
AnswerRe: Another WPF Styling Question Pin
Mycroft Holmes10-Apr-12 13:05
professionalMycroft Holmes10-Apr-12 13:05 
GeneralRe: Another WPF Styling Question Pin
Wes Aday10-Apr-12 13:27
professionalWes Aday10-Apr-12 13:27 
AnswerRe: Another WPF Styling Question Pin
Abhinav S10-Apr-12 21:23
Abhinav S10-Apr-12 21:23 
QuestionEventHandler for Pictrue Control in Windows Phone Pin
pix_programmer10-Apr-12 2:54
pix_programmer10-Apr-12 2:54 
AnswerRe: EventHandler for Pictrue Control in Windows Phone Pin
Pete O'Hanlon10-Apr-12 3:05
mvePete O'Hanlon10-Apr-12 3:05 
QuestionWPF, uncompiled XAML and scripting? Pin
Antonino Porcino9-Apr-12 21:26
Antonino Porcino9-Apr-12 21:26 
AnswerRe: WPF, uncompiled XAML and scripting? Pin
Abhinav S9-Apr-12 22:06
Abhinav S9-Apr-12 22:06 
GeneralRe: WPF, uncompiled XAML and scripting? Pin
Antonino Porcino9-Apr-12 22:19
Antonino Porcino9-Apr-12 22:19 
AnswerRe: WPF, uncompiled XAML and scripting? Pin
Mycroft Holmes10-Apr-12 0:53
professionalMycroft Holmes10-Apr-12 0:53 

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.