UWP后台更改前台元素Style,查找资源后给UI元素的Style属性赋值.如果资源在本地Page.Resource中,示例如下,MyRichEditBoxOldStyle为资源的key
redit.Style = (Style)this.Resources["MyRichEditBoxOldStyle"];
如果资源定义在App.Xaml中,写法如下
Style appButtonStyle = (Style)Application.Current.Resources["appButtonStyle"];
参考:https://docs.microsoft.com/zh-cn/windows/uwp/design/controls-and-patterns/resourcedictionary-and-xaml-resource-references