Click here to Skip to main content
15,887,027 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How to use staticresource in .cs Pin
daveyerwin7-May-09 4:57
daveyerwin7-May-09 4:57 
GeneralRe: How to use staticresource in .cs Pin
Mark Salsbery7-May-09 6:33
Mark Salsbery7-May-09 6:33 
QuestionImage in WPF like a google map ? Pin
Mohammad Dayyan6-May-09 9:31
Mohammad Dayyan6-May-09 9:31 
AnswerRe: Image in WPF like a google map ? Pin
Mark Salsbery6-May-09 10:06
Mark Salsbery6-May-09 10:06 
GeneralRe: Image in WPF like a google map ? Pin
Mohammad Dayyan6-May-09 10:12
Mohammad Dayyan6-May-09 10:12 
GeneralRe: Image in WPF like a google map ? Pin
Mark Salsbery6-May-09 12:37
Mark Salsbery6-May-09 12:37 
Question'modified' tag in WinForms - WPF Equivalent Pin
dlog1975-May-09 18:44
dlog1975-May-09 18:44 
AnswerRe: 'modified' tag in WinForms - WPF Equivalent Pin
Pete O'Hanlon5-May-09 22:15
mvePete O'Hanlon5-May-09 22:15 
What you could do (and I'd recommend this) is use two way databinding. That way, you don't have to write code to check for modified flags or the like. First of all, you should write a class that implements the interface INotifyPropertyChanged like so:
public class Login : INotifyPropertyChanged
{
  private string _name;
  public string Name
  {
    get { return _name; }
    set
    {
      if (_name != value)
      {
        _name = value;
        Changed("Name");
      }
    }
    public event PropertyChangedEventHandler;
    protected virtual void Changed(string propertyName)
    {
      PropertyChangedEventHandler handler = PropertyChanged;
      if (handler != null)
      {
        handler(this, new PropertyChangedEventArgs(propertyName));
      }
    }
  }
}
Then, in your XAML, you'd bind the textbox and the label to the same property
:<TextBox Text="{Binding Path=Name, Mode=TwoWay}" MaxLength="10" />
<Label Text="{Binding Path=Name, Mode=TwoWay}" />
Bind this object to the datacontext of your window, using this.DataContext = new Login(); in the window class (you may want to do this immediately after you the call to InitializeComponent();. Now, when you change a value in the textbox, the label updates automatically.

"WPF has many lovers. It's a veritable porn star!" - Josh Smith

As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.


My blog | My articles | MoXAML PowerToys | Onyx



GeneralRe: 'modified' tag in WinForms - WPF Equivalent Pin
Philipp Sumi6-May-09 22:01
Philipp Sumi6-May-09 22:01 
GeneralRe: 'modified' tag in WinForms - WPF Equivalent Pin
Pete O'Hanlon7-May-09 11:37
mvePete O'Hanlon7-May-09 11:37 
GeneralRe: 'modified' tag in WinForms - WPF Equivalent Pin
Pete O'Hanlon7-May-09 11:54
mvePete O'Hanlon7-May-09 11:54 
GeneralRe: 'modified' tag in WinForms - WPF Equivalent Pin
Philipp Sumi7-May-09 12:10
Philipp Sumi7-May-09 12:10 
GeneralRe: 'modified' tag in WinForms - WPF Equivalent Pin
Pete O'Hanlon7-May-09 22:30
mvePete O'Hanlon7-May-09 22:30 
GeneralRe: 'modified' tag in WinForms - WPF Equivalent Pin
Philipp Sumi7-May-09 22:45
Philipp Sumi7-May-09 22:45 
GeneralRe: 'modified' tag in WinForms - WPF Equivalent Pin
Pete O'Hanlon7-May-09 23:56
mvePete O'Hanlon7-May-09 23:56 
GeneralRe: 'modified' tag in WinForms - WPF Equivalent Pin
Philipp Sumi8-May-09 0:18
Philipp Sumi8-May-09 0:18 
GeneralRe: 'modified' tag in WinForms - WPF Equivalent Pin
Pete O'Hanlon8-May-09 2:55
mvePete O'Hanlon8-May-09 2:55 
QuestionWPF(Show data of type Varbinary in form of image in GridViewColumn) Pin
drcmomo5-May-09 9:09
drcmomo5-May-09 9:09 
AnswerRe: WPF(Show data of type Varbinary in form of image in GridViewColumn) Pin
Pete O'Hanlon5-May-09 9:36
mvePete O'Hanlon5-May-09 9:36 
GeneralRe: WPF(Show data of type Varbinary in form of image in GridViewColumn) Pin
drcmomo5-May-09 10:12
drcmomo5-May-09 10:12 
GeneralRe: WPF(Show data of type Varbinary in form of image in GridViewColumn) Pin
drcmomo5-May-09 10:19
drcmomo5-May-09 10:19 
QuestionHow to access silverlight control properties from aspx page Pin
wantToCode5-May-09 1:46
wantToCode5-May-09 1:46 
AnswerRe: How to access silverlight control properties from aspx page Pin
Ray Cassick5-May-09 2:29
Ray Cassick5-May-09 2:29 
QuestionRe: How to access silverlight control properties from aspx page Pin
wantToCode12-May-09 19:42
wantToCode12-May-09 19:42 
AnswerRe: How to access silverlight control properties from aspx page Pin
Ray Cassick13-May-09 2:25
Ray Cassick13-May-09 2:25 

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.