从正在运行的程序中对UI进行永久更改 [英] Making permanent changes to the UI from within the running program
问题描述
我有一个包含各种项目的程序.我希望用户能够为他们认为会经常使用的项目创建快捷方式(网格上的按钮).因此,我需要使用户能够向ui添加按钮,并在用户关闭界面后使其停留在该按钮上 程序.
我该如何使用ApplicationSettings或ControlSettings?或者也许是另一种方式?
我希望每次启动程序时都不会从设置中加载它(甚至在加载时间上也有关系吗?).
我希望我已经清楚了,如果您不明白,请问更多问题.
tahnks
我不太了解一个按钮是如何实现多个收藏夹的.我本来以为是功能区菜单按钮的集合.
就像这样:https://social.msdn.microsoft.com/Forums/vstudio/en-US/cc5b894d-48d3-4d58-bc11-0716878c436b/correct-method-to-navigate?forum = csharpgeneral >
您可以构建集合,并将其保存到用户设置,例如
http://stackoverflow.com/questions/845030/bind-to-a-value-defined-in-the-settings
您甚至可以直接绑定itemssource,类似于其中的代码
ItemsSource =" {Binding Source = {x:Static properties:Settings.Default}, Path = Favorites}" />您实际上可以构建复杂的ui并将其保存为未编译的xaml.
我不认为这是您想要的,但是...
在此处查看技术:
http://social.technet.microsoft.com/wiki /contents/articles/28797.wpf-dynamic-xaml.aspx
特别是可以构建整个窗口的灵活视图组合.
Hi,
I have a program with various items. I want users to be able to create a shortcut (button on a grid) for items they think they will use frequently. therefore, i need to enable users to add a button to the ui and for it to stay there after they close the program.
How do i do that with ApplicationSettings or ControlSettings? Or maybe another way?
I prefer it would not be loaded from the settings each time the program starts (does it even matter in terms of loading time?).
I hope i have been clear, ask more question if you don't understand.
tahnks
I don't really follow how one button does multiple favourites. I would have thought a collection of ribbonmenubuttons.
Like in this:https://social.msdn.microsoft.com/Forums/vstudio/en-US/cc5b894d-48d3-4d58-bc11-0716878c436b/correct-method-to-navigate?forum=csharpgeneral
And you could build the collection, save it to user settings like
http://stackoverflow.com/questions/845030/bind-to-a-value-defined-in-the-settings
You could eeven bind the itemssource directly, similar to the code there
ItemsSource="{Binding Source={x:Static properties:Settings.Default}, Path=Favourites}" />You can actually build complicated ui and save that as uncompiled xaml.
I don't think this is what you're after here but...
See the techniques here:
http://social.technet.microsoft.com/wiki/contents/articles/28797.wpf-dynamic-xaml.aspx
Particularly the flexible view composition which builds a whole window.
这篇关于从正在运行的程序中对UI进行永久更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!