Desktop Application; Extracting data from phone, .NET Framework + WPF
Windows Application for extracting data from phone, .NET Framework + WPF
整体开发模式为MVVM, WPF框架
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Resources\Values.xaml" />
<ResourceDictionary Source="/Resources\Colors.xaml" />
</ResourceDictionary.MergedDictionaries>
<WindowChrome x:Key="SubWindowChromeKey" CaptionHeight="0">
<WindowChrome.ResizeBorderThickness>
<Thickness>5</Thickness>
</WindowChrome.ResizeBorderThickness>
</WindowChrome>
//
// 加载语言
//
ResourceDictionary langRd = null;
try
{
langRd = Application.LoadComponent(
new Uri(@"Resources/Strings/String." + User.LoginUser.USER_LANGUAGE + ".xaml",
UriKind.Relative)
) as ResourceDictionary;
}
catch
{
}
if (langRd != null)
{
// 删除已设置的语言
if (Application.Current.Resources.MergedDictionaries.Count() > 2)
{
Application.Current.Resources.MergedDictionaries.RemoveAt(2);
}
// 添加新的语言
Application.Current.Resources.MergedDictionaries.Add(langRd);
}
CommonUtil.ToDerived()
基础对象转换成继承对象CommonUtil.GetParentWindow()
获取控件对象所在的窗口对象VistualTreeHelper(PresentationCore)
实现