简体   繁体   中英

How can I save text input when my textbox is in resourcedictionary?

I have 2 projects in the solution explorer. One has the resource dictionary located in the folder called "Themes". The other project is set to main startup, which has the MainWindow.xaml and MainWindow.xaml.cs. I'm just wondering if I could save whatever text I will input in the textbox coded in my resource dictionary and still there the next time I open the app The code would like this:

<TextBox telerik:PersistenceManager.StorageId="myText"    
         IsEnabled="{Binding IsEnabled}" 
         Text="{Binding Notes, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
         AcceptsReturn="True" 
         TextWrapping="Wrap" 
         BorderThickness="0"                 
         ScrollViewer.VerticalScrollBarVisibility="Auto" 
         Background="{x:Null}" Foreground="White" />

I tried to merged my resourcedictionary to MainWindow.xaml, but still can't access the textbox when I write a code behind inside the MainWindow.xaml.cs.

How should I do this? I don't have any Idea what to do. I would appreciate any kind of help.

Use application settings to persist data between sessions for a user. See Managing Application Settings (.NET) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM