xamlparseexception

Cannot instantiate UserControl from another assembly - Resource cannot be found

吃可爱长大的小学妹 提交于 2019-12-12 02:26:27
问题 I have a solution with two WPF projects: Primary and Secondary. In the Primary project, a Window named PrimaryView instantiates an UserControl called SecondaryControl, defined in Secondary project. SecondaryControl uses SecondaryStyle, which is defined in SecondaryResourceDictionary (as you might have guessed already, defined in SecondaryProject). The fact is: when I try to run the solution, I get a XamlParseError , and digging InnerExceptions I eventually find the culprit, the

How to reference existing Resources from a XamlReader.Parse(xmlFragment) call

徘徊边缘 提交于 2019-12-11 23:25:16
问题 I have a situation in which I'm creating a custom DataTemplate using XamlReader.Parse(xamlString), where xamlString is the fragment which contains the DataTemplate: <DataTemplate xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <StackPanel Visibility="{Binding MyBinding, Converter={StaticResource boolToVisibilityConverter}}"> ... </StackPanel> </DataTemplate> As you can see, this DataTemplate has a reference to a static resource (the BooleanToVisibilityConverter). The call

Microsoft.Phone.Controls.Toolkit ListPicker throws XamlParseException

北慕城南 提交于 2019-12-11 09:07:03
问题 After being advised that the native ComboBox was not the way to go I was told to look at the Silverlight Toolkit ListPicker . So I did and have got a problem. I opened a new project and pulled a new ListPicker onto the MainPage. The ListPicker looks like: <toolkit:ListPicker x:Name="Result"> <toolkit:ListPickerItem Content="Win" /> <toolkit:ListPickerItem Content="Place" /> <toolkit:ListPickerItem Content="Lose" /> </toolkit:ListPicker> When trying to run this I get an XamlParseException with

RibbonControlsLibrary XamlParseException issue VS 2010

五迷三道 提交于 2019-12-10 11:25:59
问题 I have an issue with RibbonControlsLibrary, from the beginning I'm not able to use those controls in my C# apps. The problem appears randomly, mostly after reboot. Sometimes reboot helps and it starts to run properly (without any code changes!). I tested some possibilities and the RibbonWindow control works until I put "Ribbon" control into code! Error is pointed on this control too. Strangest is that issue appears when I'm creating new WPF Ribbon Application! In fact code is as simplest as

WPF - XamlParseException when unit testing method in Window class

谁说我不能喝 提交于 2019-12-07 21:01:43
问题 I'm trying to use MSTest to write unit tests for methods in my MainWindow class in my WPF application. However, I get the following exception: System.Windows.Markup.XamlParseException: 'Provide value on 'System.Windows.StaticResourceExtension' threw an exception.' Line number '127' and line position '32'. ---> System.Exception: Cannot find resource named 'verticalLineStyle'. Resource names are case sensitive. verticalLineStyle is found in a ResourceDictionary that is included in App.xaml . I

RibbonControlsLibrary XamlParseException issue VS 2010

天大地大妈咪最大 提交于 2019-12-06 10:48:58
I have an issue with RibbonControlsLibrary, from the beginning I'm not able to use those controls in my C# apps. The problem appears randomly, mostly after reboot. Sometimes reboot helps and it starts to run properly (without any code changes!). I tested some possibilities and the RibbonWindow control works until I put "Ribbon" control into code! Error is pointed on this control too. Strangest is that issue appears when I'm creating new WPF Ribbon Application! In fact code is as simplest as it can be, but still... Anyone had this problem? I tried to google it, but couldn't find anything about

WPF - XamlParseException when unit testing method in Window class

血红的双手。 提交于 2019-12-06 07:17:29
I'm trying to use MSTest to write unit tests for methods in my MainWindow class in my WPF application. However, I get the following exception: System.Windows.Markup.XamlParseException: 'Provide value on 'System.Windows.StaticResourceExtension' threw an exception.' Line number '127' and line position '32'. ---> System.Exception: Cannot find resource named 'verticalLineStyle'. Resource names are case sensitive. verticalLineStyle is found in a ResourceDictionary that is included in App.xaml . I have no need of this style to test the method I'm trying to test, but I can't get past this. I'm just

Failed to assign to property 'System.Windows.Controls.Primitives.ButtonBase.Click'

笑着哭i 提交于 2019-12-04 04:20:16
问题 Have an interesting situation which I do not understand. Here's the scenario: I create a simple Silverlight 5 application. I place a button control on the main page and create a Click event handler. XAML is shown below..... <UserControl x:Class="SilverlightApplication6.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas

XAML parse Exception: Attribute {StaticResource PhoneAccentBrush} value is out of range

左心房为你撑大大i 提交于 2019-12-04 02:46:51
问题 I have a problem with an Exception, couldn't find the answer on how to fix it. Attribute {StaticResource PhoneAccentBrush} value is out of range. System.Windows.Application.LoadComponent(this, new System.Uri("/PAK_phone_side;component/Views/About/App_info.xaml", System.UriKind.Relative)); this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot"))); this.TitlePanel = ((System.Windows.Controls.StackPanel)(this.FindName("TitlePanel"))); this.ApplicationTitle = ((System

xamlParseException on window launch [duplicate]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 00:56:47
问题 This question already has answers here : XamlParseException after deploying WPF project (10 answers) Closed 5 years ago . I get the following error when I show this window from another window in my application: XamlParseException occurred 'Set connectionId threw an exception.' Line number '4' and line position '25'. With an inner exception of: {"Unable to cast object of type 'System.Windows.Controls.TabControl' to type 'WpfApplication1.Window1'."} My xaml code is as follows: <Window x:Class=