Click here to Skip to main content
15,880,392 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Assign a Command to a Template Item Pin
User 2710091-May-09 5:13
User 2710091-May-09 5:13 
QuestionProblem with Silverlight-Tools installation Pin
Frank Köppel27-Apr-09 6:41
Frank Köppel27-Apr-09 6:41 
QuestionRe: Problem with Silverlight-Tools installation Pin
Mark Salsbery27-Apr-09 6:59
Mark Salsbery27-Apr-09 6:59 
AnswerRe: Problem with Silverlight-Tools installation Pin
Frank Köppel27-Apr-09 22:08
Frank Köppel27-Apr-09 22:08 
GeneralRe: Problem with Silverlight-Tools installation Pin
Mark Salsbery28-Apr-09 5:26
Mark Salsbery28-Apr-09 5:26 
GeneralRe: Problem with Silverlight-Tools installation Pin
Frank Köppel29-Apr-09 0:58
Frank Köppel29-Apr-09 0:58 
GeneralRe: Problem with Silverlight-Tools installation Pin
Abhinav S9-May-09 1:28
Abhinav S9-May-09 1:28 
QuestionChange current Style on runtime Pin
Antonio Cambule27-Apr-09 3:07
Antonio Cambule27-Apr-09 3:07 
Hi,

I'm working on an small c# test-application as I'm really new to wpf/xaml coding. The App creates a WPF Window with controls and standard dynamic styles.
Runtime I would like to change the style. I don't want to remove and set another style, but get the current style of the control and change things in c# code behind.

I know how to get the style, add new Setter or trigger and remove and the style and add a new style.

What I couldn't find out, if it is possible, is how to change the property values of the given style.

Example: I have an Window with a given "Width" of 600. Now I want to change the width to 300. I could do it in c# I know, but I would like to chagne the given style. Background is, that I would like to save the style in an file and reload it later..

Some Code:

XAML

<br />
  <style x:key="MyWindowStyle" targettype="Window" xmlns:x="#unknown"><br />
  <setter property="Width" value="600" /><br />
  <setter property="Height" value="300" /><br />
</style><br />



C#
<br />
public void SetFirstTemplate()<br />
{<br />
  /* Get the Style of the Window */<br />
  MyWindowStyle = ((Style)this.Resources["MyWindowStyle"]);<br />
<br />
  /* Missing Part, what now?<br />
      * Check if the Style has an Setter with WIDTH Property<br />
      * If yes, change the value of it<br />
      * If not, add a new Setter with WidthProperty and Value<br />
  */<br />
}<br />


Has someone experience with that?
AnswerRe: Change current Style on runtime Pin
Jammer27-Apr-09 8:04
Jammer27-Apr-09 8:04 
GeneralRe: Change current Style on runtime: &gt;Still Open&lt; Pin
Antonio Cambule27-Apr-09 23:01
Antonio Cambule27-Apr-09 23:01 
Questionnotifications to user while uploading? Pin
kavetypavankumar27-Apr-09 3:06
kavetypavankumar27-Apr-09 3:06 
QuestionRe: notifications to user while uploading? Pin
Mark Salsbery27-Apr-09 7:18
Mark Salsbery27-Apr-09 7:18 
Question[Message Deleted] Pin
srikanth.penmetsa27-Apr-09 2:18
srikanth.penmetsa27-Apr-09 2:18 
QuestionRe: Doubt in silverlight Pin
Mark Salsbery27-Apr-09 7:10
Mark Salsbery27-Apr-09 7:10 
QuestionNeed help with loading help files Pin
Etienne_12326-Apr-09 2:05
Etienne_12326-Apr-09 2:05 
AnswerRe: Need help with loading help files Pin
Pete O'Hanlon26-Apr-09 22:13
mvePete O'Hanlon26-Apr-09 22:13 
GeneralRe: Need help with loading help files Pin
Etienne_12326-Apr-09 23:50
Etienne_12326-Apr-09 23:50 
GeneralRe: Need help with loading help files Pin
Pete O'Hanlon27-Apr-09 0:13
mvePete O'Hanlon27-Apr-09 0:13 
GeneralRe: Need help with loading help files Pin
Pete O'Hanlon3-May-09 1:41
mvePete O'Hanlon3-May-09 1:41 
QuestionAdding items to a ListView in WPF ? Pin
Mohammad Dayyan25-Apr-09 8:54
Mohammad Dayyan25-Apr-09 8:54 
AnswerRe: Adding items to a ListView in WPF ? Pin
Mark Salsbery25-Apr-09 9:01
Mark Salsbery25-Apr-09 9:01 
GeneralRe: Adding items to a ListView in WPF ? Pin
Mohammad Dayyan25-Apr-09 9:18
Mohammad Dayyan25-Apr-09 9:18 
GeneralRe: Adding items to a ListView in WPF ? Pin
Mark Salsbery25-Apr-09 9:26
Mark Salsbery25-Apr-09 9:26 
QuestionResource Dictionary in subprojects Pin
#realJSOP24-Apr-09 6:36
mve#realJSOP24-Apr-09 6:36 
AnswerRe: Resource Dictionary in subprojects Pin
Gideon Engelberth24-Apr-09 7:15
Gideon Engelberth24-Apr-09 7:15 

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.