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

WPF

 
AnswerRe: No fields in XamDataGrid Pin
Mycroft Holmes20-Apr-12 13:32
professionalMycroft Holmes20-Apr-12 13:32 
GeneralRe: No fields in XamDataGrid Pin
Ignaton22-Apr-12 18:16
Ignaton22-Apr-12 18:16 
Questionwcf Pin
heba abu ghaleih22 19-Apr-12 9:38
heba abu ghaleih22 19-Apr-12 9:38 
AnswerRe: wcf Pin
Abhinav S19-Apr-12 16:05
Abhinav S19-Apr-12 16:05 
GeneralRe: wcf Pin
heba abu ghaleih22 20-Apr-12 22:10
heba abu ghaleih22 20-Apr-12 22:10 
QuestionBuilding WPF UI for editing simple XML Pin
Mahesha99919-Apr-12 4:38
Mahesha99919-Apr-12 4:38 
AnswerRe: Building WPF UI for editing simple XML Pin
Richard MacCutchan19-Apr-12 4:59
mveRichard MacCutchan19-Apr-12 4:59 
AnswerRe: Building WPF UI for editing simple XML Pin
Gerry Schmitz19-Apr-12 12:34
mveGerry Schmitz19-Apr-12 12:34 
Questionmdi container Pin
MemberDotNetting19-Apr-12 3:24
MemberDotNetting19-Apr-12 3:24 
QuestionThree ScrollViewers Pin
pix_programmer17-Apr-12 18:14
pix_programmer17-Apr-12 18:14 
AnswerRe: Three ScrollViewers Pin
Gerry Schmitz19-Apr-12 12:53
mveGerry Schmitz19-Apr-12 12:53 
QuestionMVVM - Unable to use savefiledialog in the service proxy callback Pin
G Nathan16-Apr-12 20:13
G Nathan16-Apr-12 20:13 
AnswerRe: MVVM - Unable to use savefiledialog in the service proxy callback Pin
Wes Aday17-Apr-12 1:39
professionalWes Aday17-Apr-12 1:39 
QuestionBusyIndicator with uncommited new row in Datagrid throws exception Pin
AbhijeetB16-Apr-12 1:51
AbhijeetB16-Apr-12 1:51 
AnswerRe: BusyIndicator with uncommited new row in Datagrid throws exception Pin
Mycroft Holmes16-Apr-12 3:20
professionalMycroft Holmes16-Apr-12 3:20 
QuestionHow to overwrite current styles at runtime Pin
Errorrist14-Apr-12 2:44
Errorrist14-Apr-12 2:44 
QuestionLoading image to Stackpanel Pin
pix_programmer13-Apr-12 20:26
pix_programmer13-Apr-12 20:26 
AnswerRe: Loading image to Stackpanel Pin
Abhinav S13-Apr-12 20:48
Abhinav S13-Apr-12 20:48 
GeneralRe: Loading image to Stackpanel Pin
pix_programmer13-Apr-12 21:15
pix_programmer13-Apr-12 21:15 
AnswerRe: Loading image to Stackpanel Pin
Abhinav S14-Apr-12 4:53
Abhinav S14-Apr-12 4:53 
QuestionTabbed page navigation with separated navigation buttons Pin
Antonino Porcino13-Apr-12 8:52
Antonino Porcino13-Apr-12 8:52 
QuestionSet size for all "Window" in project at runtime Pin
Errorrist13-Apr-12 1:37
Errorrist13-Apr-12 1:37 
AnswerRe: Set size for all "Window" in project at runtime Pin
Wes Aday13-Apr-12 3:22
professionalWes Aday13-Apr-12 3:22 
AnswerRe: Set size for all "Window" in project at runtime Pin
Wayne Gaylard13-Apr-12 3:25
professionalWayne Gaylard13-Apr-12 3:25 
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(      )

        }

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.