![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| Guest | WPF: beginner question ... remember values in textbox Hi, With c# V2 in windows apps, I used to bind textboxes in configuration screens to a settings in the app configuration file using the property grid and its databindings category. I also save the settings each time the focus leave the textbox. The idea was to remember the latest values in the textbox. Is there any easy way to do the same using WPF ? Thanks in advance, Steve |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: WPF: beginner question ... remember values in textbox Hi, You could bind your TextBox's Text property to a .NET object's property. This property's get and set accessors would in turn deal with your AppSettings. Something like: <TextBox DataContext=myConfigurationObject Text="{Binding Path=MyProperty}"/> (Actually, I'd set DataContext higher up so that multiple TextBoxes can use it without explicitely specifying DataContext over and over again) Luc On Aug 1, 9:32 am, "Steve B." <steve_bea...@com.msn_swap> wrote: > Hi, > > With c# V2 in windows apps, I used to bind textboxes in configuration > screens to a settings in the app configuration file using the property grid > and its databindings category. I also save the settings each time the focus > leave the textbox. The idea was to remember the latest values in the > textbox. > > Is there any easy way to do the same using WPF ? > > Thanks in advance, > Steve |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: WPF: beginner question ... remember values in textbox Thanks, I try this solution <thelemmings@gmail.com> wrote in message news:1186094727.713579.39930@q3g2000prf.googlegroups.com... > Hi, > > You could bind your TextBox's Text property to a .NET object's > property. This property's get and set accessors would in turn deal > with your AppSettings. > > Something like: > > <TextBox DataContext=myConfigurationObject Text="{Binding > Path=MyProperty}"/> > (Actually, I'd set DataContext higher up so that multiple TextBoxes > can use it without explicitely specifying DataContext over and over > again) > > Luc > > On Aug 1, 9:32 am, "Steve B." <steve_bea...@com.msn_swap> wrote: >> Hi, >> >> With c# V2 in windows apps, I used to bind textboxes in configuration >> screens to a settings in the app configuration file using the property >> grid >> and its databindings category. I also save the settings each time the >> focus >> leave the textbox. The idea was to remember the latest values in the >> textbox. >> >> Is there any easy way to do the same using WPF ? >> >> Thanks in advance, >> Steve > > |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| VB.NET beginner Question | .NET General | |||
| Copying Textbox values in Gridview with Javascript | .NET General | |||
| Question about WMI from a scripting beginner... | PowerShell | |||
| General beginner question | PowerShell | |||