- 浏览: 399809 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (309)
- xaml C# wpf (0)
- scala java inner clas (1)
- Tools UML Eclipse UML2 (1)
- Timer .NET Framework (1)
- perl (6)
- python function paramter (1)
- Python Docstring (1)
- Python how to compare types (1)
- Python (8)
- java (5)
- C# (76)
- C# WPF (0)
- p4 (0)
- WPF (46)
- .net (6)
- xaml (1)
- javascript (40)
- windows (10)
- scala (4)
- winform (1)
- c++ (48)
- tools (12)
- cmd (1)
- os (0)
- CI (0)
- shell (0)
- C (2)
- haskell (49)
- functional (1)
- tool (1)
- gnu (1)
- linux (1)
- kaskell (0)
- svn (0)
- wcf (3)
- android (1)
最新评论
NOTE: do not confuse the embedded resource and the Resource in WPF. Embedded Resource is an old term that is used in Windows Form application, while the Resource is used in WPF.
Please see "Embedded and Resource" for more details.
Suppose that you have this layout of files
and you have one View that will load the Views, you can use the Pack uri to do this.
Suppose that the project name is called "TRecsSupportModule", you can do this:
Uri uri = new Uri("/TRecsSupportModule;component/resource/style/MergedStyles.xaml", UriKind.RelativeOrAbsolute); StreamResourceInfo info = Application.GetResourceStream(uri); System.Windows.Markup.XamlReader reader = new System.Windows.Markup.XamlReader(); ResourceDictionary page = (ResourceDictionary)reader.LoadAsync(info.Stream); this.Resources.MergedDictionaries.Add(page);
You can specify the Uri as follow (in which case, you don't need to provide the UriKind enum)
Uri uri = new Uri("pack://application:,,,/TRecsSupportModule;component/mergedstyles.xaml");
If the resource is not coming from some dependency assemblies, you can ignore the ReferenceDll part, and the Uri can be written as such.
Uri uri = new Uri("/resource/style/MergedStyles.xaml", UriKind.RelativeOrAbsolute);
And you may ignore the leading '/'.
Uri uri = new Uri("resource/style/MergedStyles.xaml", UriKind.RelativeOrAbsolute);
When you do this, you might set the xaml file /TRecsSupportModule;component/Resource/Style/MergedStyles.xaml (Build Action: Resource), as compared agains the (BuildAction: Page), which may not work.
发表评论
-
wpf - example to enhance ComboBox for AutoComplete
2014-09-19 15:56 1976first let’s see an example ... -
WPF – Virtualization – VirutalizationStackPanel and ItemsPanelTemplate
2013-08-05 21:55 1410Topic: WPF – Virtualization – ... -
wpf - BehaviorBase and one use examples
2013-06-18 18:41 1311Behavior is something that we ... -
WPF - Setting foreground color of Entire window
2013-06-13 16:00 1918You might as well as I would s ... -
WPF - Enhanced TabControl - TabControlEx aka Prerendering TabControl
2013-06-13 13:12 5330As an opening word, let's che ... -
wpf - ControlTemplate and AddLogicChild/RemoveLogicalChild
2013-06-10 15:42 1185Recently I was trying to debug ... -
wpf - default implicit style
2013-05-10 10:24 794We know that if you left out ... -
wpf - Style setter on the attached property
2013-05-08 14:54 2852I believe that you are familia ... -
wpf - specify enum values in xaml
2013-05-08 11:31 3585Many a situation you find tha ... -
wpf - IG xamDataGrid bind to XmlDataProvider with Xml Island
2012-12-18 14:28 1286Sometimes you may bind to some ... -
wpf - translate winform button/mouse event to wpf events
2012-12-12 17:37 2162It is common that we sometimes ... -
wpf - Freezable and its meaning
2012-09-27 12:38 0This article is based on the di ... -
wpf - Customize the grid lines for original wpf Grid control
2012-09-27 12:01 1458The System.WIndows.Controls.Gri ... -
c# - Convert from System.Drawing.Image to System.WIndows.Media.ImageSource
2012-09-25 14:27 7417In Previous discussion, we have ... -
wpf - Get Effective DependencyProperty value on a DependencyObject
2012-08-28 19:05 1044As discussed in my previous pos ... -
wpf - Default(Theme) style and its DefaultStyleKey
2012-08-28 17:54 1387As dicsused in the subsection o ... -
wpf - Dependency Property Value Precedence
2012-08-28 18:56 882A dependency property to an Dep ... -
wpf - WPF TemplateBinding vs RelativeSource TemplatedParent
2012-08-28 14:20 3713This is a post that summarizes ... -
wpf - ICutomTypeDescriptor , PropertyDescriptor and its use in PropertyGrid
2012-08-28 14:04 3580The type ICustomTypeDe ... -
wpf - tips to convert UI controls in WPF/Silverlight/Winforms into a Bitmap
2012-08-27 17:44 976In previous discussion, we have ...
相关推荐
In the second example we look at mocking, and learn how to use it simulate our hardware. All the tests in these examples compile and run on your host PC (with GCC), with no target hardware needed.
However, if you have some programming experience and are familiar with C or C++, you're ready to learn how to write embedded software. The hands-on, no-nonsense style of this book will help you get ...
In addition to learning how to use C and C++ more effectively, you'll also benefit from the detailed explanations and source code solutions to common embedded software problems. Among the advanced ...
本书《Design Patterns for Embedded Systems in C》作为嵌入式软件工程工具箱,作者Bruce Powell Douglass博士基于丰富的嵌入式软件工程经验,详细介绍了在嵌入式系统编程中使用C语言时可以运用的设计模式。...
WPF_嵌入字体_EmbeddedFont
You will gain a strong foundation in using embedded systems by learning how to program the device driver and access the peripherals. You will also learn how to read and write data from/to the ...
Christopher Hallinan offers solutions for the specific technical issues you’re most likely to face, demonstrates how to build an effective embedded Linux environment, and shows how to use it as ...
There's a great deal of excitement surrounding the use of Linux in embedded systems -- for everything from cell phones to car ABS systems and water-filtration plants -- but not a lot of practical ...
This book, now in its 5th edition, is the first in a series of three books that teach the fundamentals of embedded systems as applied to the ARM® Cortex™-M family of microcontrollers. This first ...
Christopher Hallinan offers solutions for the specific technical issues you're most likely to face, demonstrates how to build an effective embedded Linux environment, and shows how to use it as ...
在IT行业中,尤其是在Windows Presentation Foundation (WPF)应用开发中,有时我们需要在应用程序内部集成一个浏览器组件,以便用户能够浏览网页内容或者实现某些基于Web的功能。`Xilium.CefGlue`就是这样一个库,它...
You'll be given an overview of the available Yocto Project components, how to set up Yocto Project Eclipse IDE, and how to use tools such as Wic and Swabber that are still under development....
Embedded Firmware Solutions: Development Best Practices for the Internet of Things is the perfect introduction and daily-use field guide--for the thousands of firmware designers, hardware engineers, ...
use 7-zip to unzip By Insup Lee, Joseph Y-T. Leung, Sang H. Son Publisher: Chapman & Hall/CRC Number Of Pages: 800 Publication Date: 2007-07-23 ISBN-10 / ASIN: 1584886781 ISBN-13 / EAN: ...