Tag: mahapps.metro

使用MahApps保持样式在WPF中扩展TextBox

我创建了一个自定义文本框类,用于validation用户的输入以仅允许hex值,并在xaml中使用此新文本框(HexTextBox)。 它运行良好,但HexTextBox丢失了Mahapps的所有样式,包括配色方案和TextBoxHelper。 你知道如何使用这个扩展的TexBox并保持风格吗? HexTextBox: public class HexTextBox : TextBox { public HexTextBox() { } /// /// Raise when a keyboard key is pressed. /// /// The event args. protected override void OnPreviewKeyDown(KeyEventArgs e) { if (e.Key == Key.Space) { e.Handled = true; } base.OnPreviewKeyDown(e); } /// /// Raise when a text will be inputed in […]

如何将MahApps.Metro捆绑到单个exe中

由于MahApps.Metro,我很难将使用SmartAssembly 6(评估/试用版)将我的C#WPF项目中的所有依赖项捆绑到单个exe中。 这个结论是在创建一个除了MahApps.Metro之外什么都没有的完全空项目时得出的,但仍然无法捆绑它。 它会引发内部exception的exceptionSystem.IO.FileNotFoundException: Could not load file or assembly ‘System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException: Could not load file or assembly ‘System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified. 我花了一天半的时间试图解决这个问题,谷歌搜索错误,尝试我能找到的每一个建议,然后发布官方MahApps.Metro聊天( https://gitter.im/MahApps/MahApps.Metro )。 我尝试了各种各样的变化,我删除了System.Windows.Interactivity dll,添加它,将它移动到另一个路径等。 使用NuGet和.NET […]