Search Results

Search found 2571 results on 103 pages for 'winrt xaml'.

Page 3/103 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Say goodbye to System.Reflection.Emit (any dynamic proxy generation) in WinRT

    - by mbrit
    tl;dr - Forget any form of dynamic code emitting in Metro-style. It's not going to happen.Over the past week or so I've been trying to get Moq (the popular open source TDD mocking framework) to work on WinRT. Irritatingly, the day before Release Preview was released it was actually working on Consumer Preview. However in Release Preview (RP) the System.Reflection.Emit namespace is gone. Forget any form of dynamic code generation and/or MSIL injection.This kills off any project based on the popular Castle Project Dynamic Proxy component, of which Moq is one example. You can at this point in time not perform any form of mocking using dynamic injection in your Metro-style unit testing endeavours.So let me take you through my journey on this, so that other's don't have to...The headline fact is that you cannot load any assembly that you create at runtime. WinRT supports one Assembly.Load method, and that takes the name of an assembly. That has to be placed within the deployment folder of your app. You cannot give it a filename, or stream. The methods are there, but private. Try to invoke them using Reflection and you'll be met with a caspol exception.You can, in theory, use Rotor to replace SRE. It's all there, but again, you can't load anything you create.You can't write to your deployment folder from within your Metro-style app. But, can you use another service on the machine to move a file that you create into the deployment folder and load it? Not really.The networking stack in Metro-style is intentionally "damaged" to prevent socket communication from Metro-style to any end-point on the local machine. (It just times out.) This militates against an approach where your Metro-style app can signal a properly installed service on the machine to create proxies on its behalf. If you wanted to do this, you'd have to route the calls through a C&C server somewhere. The reason why Microsoft has done this is obvious - taking out SRE know means they don't have to do it in an emergency later. The collateral damage in removing SRE is that you can't do mocking in test mode, but you also can't do any form of injection in production mode. There are plenty of reasons why enterprise apps might want to do this last point particularly. At CP, the assumption was that their inspection tools would prevent SRE being used as a malware vector - it now seems they are less confident about that. (For clarity, the risk here is in allowing a nefarious program to download instructions from a C&C server and make up executable code on the fly to run, getting around the marketplace restrictions.)So, two things:- System.Reflection.Emit is gone in Metro-style/WinRT. Get over it - dynamic, on-the-fly code generation is not going to to happen.- I've more or less got a version of Moq working in Metro-style. This is based on the idea of "baking" the dynamic proxies before you use them. You can find more information here: https://github.com/mbrit/moqrt

    Read the article

  • Can anybody recommend C#/XAML Windows Store Development aggregator sites?

    - by Clay Shannon
    I used to have a couple of sites bookmarked that were Windows development article/blog post aggregators. I can't recall what they were called. What I want to do now is to keep up with all relevant C#/XAML "Windows Store" app development info, whether it be blog posts, new "Metro"-specific channel 9 videos, etc., without spending lots of time surfing about. Can anybody recommend any "C#/XAML Windows Store new information aggregators"?

    Read the article

  • Manually parse string as XAML Attribute

    - by bitbonk
    How does the XAML Parser convert the string "Red" in Foreground="Red" to a SolidColorBrush? Allthough I know the Types have System.ComponentModel.TypeConverter defined, I doupt that the WPF XAML parser acutally always uses those to convert the string to the brush. Are there any XAML APIs apart from XamlReader.Load (wich wants a valid xml string) that I could use to parse a single string as if it where an attibute for a certain property?

    Read the article

  • Adding ComboBoxItem to a combobox inside a user control (XAML/WPF)

    - by byte
    I am currently learning to create custom controls in WPF. I successfully created a simple custom control using a Label and a Text Box. I was able to allow setting the Label text by DependencyProperty. Now I am creating a user control that has a ComboBox. I need to allow adding items to this ComboBox from outside the control. To achieve this, I tried exposing a DependencyProperty of type ItemsCollection and it will allows access to the ComboBox's Items property (the DP in my control sample is named 'CbItems'). But I get errors because Items property of Combobox is ReadOnly. Control XAML <UserControl x:Class="MyWpfApp.Controls.MyControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="Auto" Width="Auto"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Label Grid.Column="0" Content="{Binding FieldLabel}"></Label> <ComboBox Name="cmb" Grid.Column="1" Width="150"></ComboBox> </Grid> </UserControl> MainWindow XAML <Window x:Class="MyWpfApp.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ctl="clr-namespace:MyWpfApp.Controls" Title="Window1" Height="300" Width="300"> <Grid> <ctl:MyControl> <ctl:MyControl.CbItems> <ComboBoxItem>Hello</ComboBoxItem> <ComboBoxItem>World</ComboBoxItem> <ComboBoxItem>Hi</ComboBoxItem> </ctl:LobCombox.CbItems> </ctl:LobCombox> </Grid> </Window> I would like to know what the correct way is to achieve this functionality. I believe the answer to this might also help with other controls like GridView etc Many Thanks

    Read the article

  • Custom UserControl property not being set via XAML DataBinding in Silverlight 4

    - by programatique
    I have a custom user control called GoalProgressControl. Another user control contains GoalProgressControl and sets its GoalName attribute via databinding in XAML. However, the GoalName property is never set. When I check it in debug mode GoalName remains "null" for the control's lifetime. How do I set the GoalName property? Is there something I am doing incorrectly? I am using .NET Framework 4 and Silverlight 4. I am relatively new to XAML and Silverlight so any help would be greatly appreciated. I have attempted to change GoalProgressControl.GoalName into a POCO property but this causes a Silverlight error, and my reading leads me to believe that databound properties should be of type DependencyProperty. I've also simplified my code to just focus on the GoalName property (the code is below) with no success. Here is GoalProgressControl.xaml: <UserControl x:Class="GoalView.GoalProgressControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" DataContext="{Binding RelativeSource={RelativeSource Self}}" Height="100"> <Border Margin="5" Padding="5" BorderBrush="#999" BorderThickness="1"> <TextBlock Text="{Binding GoalName}"/> </Border> </UserControl> GoalProgressControl.xaml.cs: public partial class GoalProgressControl : UserControl, INotifyPropertyChanged { public GoalProgressControl() { InitializeComponent(); } public event PropertyChangedEventHandler PropertyChanged; public void NotifyPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } public static DependencyProperty GoalNameProperty = DependencyProperty.Register("GoalName", typeof(string), typeof(GoalProgressControl), null); public string GoalName { get { return (String)GetValue(GoalProgressControl.GoalNameProperty); } set { base.SetValue(GoalProgressControl.GoalNameProperty, value); NotifyPropertyChanged("GoalName"); } } } I've placed GoalProgressControl on another page: <Grid Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="5" Background="#eee" Height="200"> <Border BorderBrush="#999" BorderThickness="1" Background="White"> <StackPanel> <hgc:SectionTitleBar x:Name="ttlGoals" Title="Personal Goals" ImageSource="../Images/check.png" Uri="/Pages/GoalPage.xaml" MoreVisibility="Visible" /> <ItemsControl ItemsSource="{Binding Path=GoalItems}"> <ItemsControl.ItemTemplate> <DataTemplate> <!--TextBlock Text="{Binding Path=[Name]}"/--> <goal:GoalProgressControl GoalName="{Binding Path=[Name]}"/> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </StackPanel> </Border> </Grid> Please note the commented out "TextBlock" item above. If I comment in the TextBlock and comment out the GoalProgressControl, the binding works correctly and the TextBlock shows the GoalName correctly. Also, if I replace the "GoalName" property above with a simple text string (ex "hello world"), the control renders correctly and "hello world" is shown on the control when it renders.

    Read the article

  • Embed XAML in XML Schema

    - by Michael Stoll
    I'm developping a xml data format. Besides other data there should be a xaml drawing. So I wanted to have a xml element, which can contain any valid xaml. How can this be expressed in the XML Schema? I tried to import the xaml schema, but I couldn't find a xsd file for it. The makeshift would be to use an encoded string.

    Read the article

  • WF4RC, How to: Activity to Xaml?

    - by johnny g
    Hello all, I have Googled a bit, and cannot seem to find any examples of Xaml-fying Activities - good, bad, or otherwise! public static string ToXaml (this Activity activity) { // i would use ActivityXamlServices to go from Xaml // to activity, but how to go other way? documentation // is slim, and cannot infer proper usage of // ActivityXamlServices from Xml remarks :S string xaml = string.Empty; return xaml; } Hints, tips, pointers would be welcome :) NOTE: so found this. Will work through and update once working. Anyone wanna beat me to the punch, by all means. Better yet, if you can find a way to be rid of WorkflowDesigner, seems odd it is required.

    Read the article

  • How to use App.Xaml's ResourseDictionaries with own entry point

    - by Polaris
    Hello friends. I created some logic for singleInstance application and I must to use my own entry point (not App.xaml) for Application. I have some styles in App.xaml which now is not working. How can I use this ResourceDictionaries from my App.xaml for entire project in my situation? My class for manage Application Startup public class SingleInstanceManager : WindowsFormsApplicationBase { App app; public SingleInstanceManager() { this.IsSingleInstance = true; } protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs e) { try { // First time app is launched app = new App(); App.Current.Properties["rcID"] = e.CommandLine; //IntroLibrary.OpenDocumentFromNotify(); app.Run(); return false; } catch (Exception ex) { MessageBox.Show(ex.Message); return false; } } protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { // Subsequent launches base.OnStartupNextInstance(eventArgs); Intro win = (Intro)app.MainWindow; if (eventArgs != null) { App.Current.Properties["rcID"] = eventArgs.CommandLine[0]; } IntroLibrary.OpenDocumentFromNotify(); app.Activate(); } } and my own Entry Point: public class EntryPoint { [STAThread] public static void Main(string[] args) { SingleInstanceManager manager = new SingleInstanceManager(); manager.Run(args); } } And my App.Xaml code behind: public partial class App : Application { protected override void OnStartup(System.Windows.StartupEventArgs e) { base.OnStartup(e); // Create and show the application's main window Intro window = new Intro(); window.Show(); } public void Activate() { // Reactivate application's main window this.MainWindow.Activate(); } } And my App.xaml has some code which decribe ResourceDictionaries which doesnt work. Why?

    Read the article

  • How do XAML files associate with cs files?

    - by LLS
    It seems that XAML files should have corresponding .cs files in a C# project. I know Visual Studio does all the things for us. I'm just curious how they are linked together? I mean, are they specified in the project file, or just because they have the same names? And also, App.xaml file specifies the startup file, but how does the compiler know? Is it possible to appoint another file other than App.xaml to do the same things as App.xaml does?

    Read the article

  • Theme-aware XAML resources in a WP7 project

    - by SandRock
    I'm making a Windows Phone 7 application and I'm a bit confused with dark/light themes. With a panorama, you very often set a background image. The issue is it's very hard to make a picture which is right for both dark and light themes. How are we supposed to proceed? Is there a way to force a dark/light theme for a panorama? This will avoid making theme-specific panorama background pictures. Then how do I do? I found xaml files in C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Design. If this is a right way to proceed, how can I import them for my panorama? Or if there's no way (or if it's wrong) to force a dark/light theme: how to write conditional XAML to set correct resources? Now I have the following XAML which is fine with the dark theme: <ImageBrush x:Key="PageBackground" ImageSource="Resources/PageBackground.png" Stretch="None" /> <ImageBrush x:Key="PanoramaBackground" ImageSource="Resources/PanoramaBackground.png" Stretch="None" /> But when I use a light theme, black controls and black texts are hard to read with my dark background pictures. So I made different pictures that I can use this way: <ImageBrush x:Key="PageBackground" ImageSource="Resources/PageBackgroundLight.png" Stretch="None" /> <ImageBrush x:Key="PanoramaBackground" ImageSource="Resources/PanoramaBackgroundLight.png" Stretch="None" /> Now my issue is to make XAML conditionnal to declare the right thing depending on the current theme. I found no relevant way on the Internet. I would prefer not to use code or code-behind for that because I believe XAML is able to do this (I just don't know how).

    Read the article

  • C# WPF XAML Loading

    - by user3713589
    Hi I'd like to inquire on how i can load a WPF Xaml into code so that I can change the values of the attributes of some XAML elements and output it by creating another XAML files. This is so that I can output the same file with values dynamically input by the user. the XamlReader.Load() method cannot be used; it will throw an exception (because they are unable to recognise Window as the root element). I'm using VS2013 and C#.

    Read the article

  • Dynamic Scoped Resources in WPF/XAML?

    - by firoso
    I have 2 Xaml files, one containing a DataTemplate which has a resource definition for an Image brush, and the other containing a content control which presents this DataTemplate. The data template is bound to a view model class. Everything seems to work EXCEPT the ImageBrush resource, which just shows up white... Any ideas? File 1: DataTemplate for ViewModel <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vm="clr-namespace:SEL.MfgTestDev.ESS.ViewModel" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> <DataTemplate DataType="{x:Type vm:PresenterViewModel}"> <DataTemplate.Resources> <ImageBrush x:Key="PresenterTitleBarFillBrush" TileMode="Tile" Viewbox="{Binding Path=FillBrushDimensions, Mode=Default}" ViewboxUnits="Absolute" Viewport="{Binding Path=FillBrushPatternSize, Mode=Default}" ViewportUnits="Absolute" ImageSource="{Binding Path=FillImage, Mode=Default}"/> </DataTemplate.Resources> <Grid d:DesignWidth="1440" d:DesignHeight="900"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="192"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="120"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <DockPanel HorizontalAlignment="Stretch" Width="Auto" LastChildFill="True" Background="{x:Null}" Grid.ColumnSpan="2"> <Image Source="{Binding Path=ImageSource, Mode=Default}"/> <Rectangle Fill="{DynamicResource PresenterTitleBarFillBrush}"/> </DockPanel> </Grid> </DataTemplate> </ResourceDictionary> File 2: Main Window Class which instanciates the DataTemplate Via it's view model. <Window x:Class="SEL.MfgTestDev.ESS.ESSMainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vm="clr-namespace:SEL.MfgTestDev.ESS.ViewModel" Title="ESS Control Window" Height="900" Width="1440" WindowState="Maximized" WindowStyle="None" ResizeMode="NoResize" DataContext="{Binding}"> <Window.Resources> <ResourceDictionary Source="PresenterViewModel.xaml" /> </Window.Resources> <ContentControl> <ContentControl.Content> <vm:PresenterViewModel ImageSource="XAMLResources\SEL25YearsTitleBar.bmp" FillImage="XAMLResources\SEL25YearsFillPattern.bmp" FillBrushDimensions="0,0,5,110" FillBrushPatternSize="0,0,5,120"/> </ContentControl.Content> </ContentControl> </Window> And for the sake of completeness! The CodeBehind for the View Model using System; using System.Collections.Generic; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; namespace SEL.MfgTestDev.ESS.ViewModel { public class PresenterViewModel : ViewModelBase { public PresenterViewModel() { } //DataBindings private ImageSource _imageSource; public ImageSource ImageSource { get { return _imageSource; } set { if (_imageSource != value) { _imageSource = value; OnPropertyChanged("ImageSource"); } } } private Rect _fillBrushPatternSize; public Rect FillBrushPatternSize { get { return _fillBrushPatternSize; } set { if (_fillBrushPatternSize != value) { _fillBrushPatternSize = value; OnPropertyChanged("FillBrushPatternSize"); } } } private Rect _fillBrushDimensions; public Rect FillBrushDimensions { get { return _fillBrushDimensions; } set { if (_fillBrushDimensions != value) { _fillBrushDimensions = value; OnPropertyChanged("FillBrushDimensions"); } } } private ImageSource _fillImage; public ImageSource FillImage { get { return _fillImage; } set { if (_fillImage != value) { _fillImage = value; OnPropertyChanged("FillImage"); } } } } }

    Read the article

  • XAML to HTML Conversion - WPF RichTextBox

    - by Erika
    I have the problem where i have a WPF RichTextBox, and i'm extracting its XAML code and saving it to a txt file. When i copy paste the XAML code generated to a XAMLtoHTML converter like this http://blogs.msdn.com/wpfsdk/archive/2006/05/25/606317.aspx , some error must be occuring as i'm always getting a blank result! If i write test in the RichTextBox i get the following XAML: <Section xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml:space="preserve" TextAlignment="Left" LineHeight="Auto" IsHyphenationEnabled="False" xml:lang="en-us" FlowDirection="LeftToRight" NumberSubstitution.CultureSource="Text" NumberSubstitution.Substitution="AsCulture" FontFamily="Segoe UI" FontStyle="Normal" FontWeight="Normal" FontStretch="Normal" FontSize="12" Foreground="#FF000000" Typography.StandardLigatures="True" Typography.ContextualLigatures="True" Typography.DiscretionaryLigatures="False" Typography.HistoricalLigatures="False" Typography.AnnotationAlternates="0" Typography.ContextualAlternates="True" Typography.HistoricalForms="False" Typography.Kerning="True" Typography.CapitalSpacing="False" Typography.CaseSensitiveForms="False" Typography.StylisticSet1="False" Typography.StylisticSet2="False" Typography.StylisticSet3="False" Typography.StylisticSet4="False" Typography.StylisticSet5="False" Typography.StylisticSet6="False" Typography.StylisticSet7="False" Typography.StylisticSet8="False" Typography.StylisticSet9="False" Typography.StylisticSet10="False" Typography.StylisticSet11="False" Typography.StylisticSet12="False" Typography.StylisticSet13="False" Typography.StylisticSet14="False" Typography.StylisticSet15="False" Typography.StylisticSet16="False" Typography.StylisticSet17="False" Typography.StylisticSet18="False" Typography.StylisticSet19="False" Typography.StylisticSet20="False" Typography.Fraction="Normal" Typography.SlashedZero="False" Typography.MathematicalGreek="False" Typography.EastAsianExpertForms="False" Typography.Variants="Normal" Typography.Capitals="Normal" Typography.NumeralStyle="Normal" Typography.NumeralAlignment="Normal" Typography.EastAsianWidths="Normal" Typography.EastAsianLanguage="Normal" Typography.StandardSwashes="0" Typography.ContextualSwashes="0" Typography.StylisticAlternates="0"><Paragraph><Run>test</Run></Paragraph></Section> pleaseee help!! Any Ideas?

    Read the article

  • Problem with relative path to image in XAML?

    - by Giri
    I am trying to reference a PNG file in my applications working directory through XAML with the following: <Image Name="contactImage"> <Image.Source> <BitmapImage UriSource="/Images/contact.png"> </Image.Source> </Image> Now in my code-behind I try to get the height of the image with contactImage.Source.Height This fails with System.IOException - cannot locate resource 'images/contact.png'. If I use something like PngBitmapDecoder p = new PngBitmapDecoder(new Uri("./Images/contact.png"), UriKind.Relative, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); Everything is happy. How can I reference an image in xaml to a path relative to the working deirectory of the app. BTW- this is being run on a remote machine (if that makes a difference). I have tried "./Images/contact.png" and ".\Images\contact.png" and several other combinations of back/forward slashes and dots. Here is the primary difference- Any time the file is referenced in XAML, it shows up as pack://aplication:,,, blah blah blah when I use the PngBitmapDecoder, it shows up correctly as "./Images/contact.png". How do I reference the image file in XAML and get it show a source as "./Images/contact.png" instead of a pack://application,,,blah blah blah?

    Read the article

  • Cannot access resource defined in app.xaml

    - by DerKlaus
    I am using Visual Studio 2010 RC1. I define a resource "Brush2" in app.xaml_: <Application x:Class="VideoThumbnails.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> <Application.Resources> <RadialGradientBrush x:Key="Brush2" RadiusX="1" RadiusY="1" GradientOrigin="0.3,0.3"> <GradientStop Color="White" Offset="0"/> <GradientStop Color="#ffc0c0" Offset="1"/> </RadialGradientBrush> </Application.Resources> </Application> In my Mainwindow I am trying to use that resource: ... <Border Margin="4,2" BorderBrush="Black" BorderThickness="2" CornerRadius="4" ToolTip="{Binding Path=FullPath}" HorizontalAlignment="Stretch" Background="{StaticResource Brush2}"> ... No matter what I do it always raises an exception at runtime (Resource not found). I changed build action without success. How can I use resources defined in app.xaml?

    Read the article

  • Convert XAML to FlowDocument to display in RichTextBox in WPF

    - by Erika
    I have some HTML, which i am converting to XAML using the library provided by Microsoft string t = HtmlToXamlConverter.ConvertHtmlToXaml(mail.HtmlDataString,true); now, from http://stackoverflow.com/questions/1449121/how-to-insert-xaml-into-richtextbox i am using the following: private static FlowDocument SetRTF(string xamlString) { StringReader stringReader = new StringReader(xamlString); System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(stringReader); Section sec = XamlReader.Load(xmlReader) as Section; FlowDocument doc = new FlowDocument(); while (sec.Blocks.Count > 0) doc.Blocks.Add(sec.Blocks.FirstBlock); return doc; } This however keeps crashing unfortunately =/ Does anyone have any clue on how to display XAML text in a RichTextBox please?

    Read the article

  • XAML Parsing Exception

    - by e28Makaveli
    I have a simple XAML page that load fine when it is loaded as part of any application within Visual Studio. However, when I deploy this application using ClickOnce, I get the following exception: Type : System.Windows.Markup.XamlParseException, PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 Message : Unable to cast object of type 'System.Windows.Controls.Grid' to type 'EMS.Controls.Dictionary.StatusBarControl'. Error at object 'System.Windows.Controls.Grid' in markup file 'EMS.Controls.Dictionary;component/views/statusbarcontrol.xaml'. Source : PresentationFramework Help link : LineNumber : 0 LinePosition : 0 KeyContext : UidContext : NameContext : BaseUri : pack://application:,,,/EMS.Controls.Dictionary;component/views/statusbarcontrol.xaml Data : System.Collections.ListDictionaryInternal TargetSite : Void ThrowException(System.String, System.Exception, Int32, Int32, System.Uri, System.Windows.Markup.XamlObjectIds, System.Windows.Markup.XamlObjectIds, System.Type) Stack Trace : at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType) at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord) at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment() at System.Windows.Markup.TreeBuilder.Parse() at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) at EMS.Controls.Dictionary.StatusBarControl.InitializeComponent() at EMS.Controls.Dictionary.StatusBarControl..ctor(IDataView content) at OCC600.ReportManager.ReportPresenter.ShowQueryView(Object arg, Boolean bringForward, Type selectedDataType) at OCC600.ReportManager.ReportPresenter..ctor(IUnityContainer container) at OCC600.ReportManager.Module.Initialize() at Microsoft.Practices.Composite.Modularity.ModuleLoader.Initialize(ModuleInfo[] moduleInfos) Inner Exception --------------- Type : System.InvalidCastException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : Unable to cast object of type 'System.Windows.Controls.Grid' to type 'EMS.Controls.Dictionary.StatusBarControl'. Source : EMS.Controls.Dictionary Help link : Data : System.Collections.ListDictionaryInternal TargetSite : Void System.Windows.Markup.IComponentConnector.Connect(Int32, System.Object) Stack Trace : at EMS.Controls.Dictionary.StatusBarControl.System.Windows.Markup.IComponentConnector.Connect(Int32 connectionId, Object target) at System.Windows.Markup.BamlRecordReader.ReadConnectionId(BamlConnectionIdRecord bamlConnectionIdRecord) at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) The XAML page is given below: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cdic="clr-namespace:EMS.Controls.Dictionary.Primitives" xmlns:dicutil="clr-namespace:OCC600.Infrastructure.Dictionary.Utility;assembly=EMS.Infrastructure.Dictionary" Loaded="ResultSetControl_Loaded" <StatusBarItem Margin="10,0, 10, 0"> <TextBlock Text="{Binding CountText}" Padding="5,0"/> </StatusBarItem> <StatusBarItem Margin="10,0"> <TextBlock Text="{Binding MemoryUsageText}" Padding="5,0"/> </StatusBarItem> <StatusBarItem Margin="10,0" MaxWidth="400"> <TextBlock Text="{Binding StatusReport.Summary}" Padding="5,0" /> </StatusBarItem> <ProgressBar Margin="20,0" Name="progBar" Width="150" Height="13" Visibility="Collapsed" > <ProgressBar.ContextMenu> <ContextMenu Name="ctxMenu" ItemsSource="{Binding ActiveWorkItems}" Visibility="{Binding Path=ActiveWorkItems.HasItems, Converter={StaticResource BooToVisConv}}"> <ContextMenu.ItemContainerStyle> <Style TargetType="{x:Type MenuItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type MenuItem}"> <StackPanel Height="20" Margin="10,0" Orientation="Horizontal" HorizontalAlignment="Left"> <TextBlock Text="{Binding Path=Name, Mode=OneTime}" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Left" /> <ToggleButton Style="{StaticResource vistaGoldenToggleButtonStyle}" Padding="5,0" Content="Cancel" IsChecked="{Binding Cancel}" Margin="10,0,0,0" > </ToggleButton> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style> </ContextMenu.ItemContainerStyle> </ContextMenu> </ProgressBar.ContextMenu> </ProgressBar> <StatusBarItem Margin="10,0" MaxWidth="400" HorizontalAlignment="Right"> <StackPanel Orientation="Horizontal"> <TextBlock Text="Last Update:" Padding="5,0" /> <TextBlock Text="{Binding TimeStamp}" Padding="5,0" /> </StackPanel> </StatusBarItem> <!-- TODO: Put checkmark if all is well, or error if connection failed--> <StatusBarItem Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly=dc:Ribbon, ResourceId=StatusBarItemAlt}}" DockPanel.Dock="Right" Padding="6,0,32,0" > <cdic:SplitButton Margin="5,0" Padding="5,2" Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type cdic:SplitButtonResources}, ResourceId=vistaSplitButtonStyle}}" Mode="Split"> <cdic:SplitButton.ContextMenu> <ContextMenu > <MenuItem Header="Refresh Now" Command="{Binding ToggleConnectivityCmd}" CommandParameter="false"/> <MenuItem IsCheckable="True" IsChecked="{Binding ConnectState, Converter={StaticResource isFailedConverter}}" CommandParameter="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=IsChecked}" Header="Work Offline" Command="{Binding ToggleConnectivityCmd}"/> </ContextMenu> </cdic:SplitButton.ContextMenu> <cdic:SplitButton.Content> <StackPanel Orientation="Horizontal"> <Image x:Name="img" Source="{Binding ConnectState, Converter={StaticResource imageConverter}}" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/> <TextBlock Text="{Binding ConnectState}" Padding="3,0,0,0"/> </StackPanel> </cdic:SplitButton.Content> </cdic:SplitButton> </StatusBarItem> </StatusBar> </Grid> The error just seems to have come out of no where. Any ideas? TIA.

    Read the article

  • XAML Serialization object not using asp.net shadow copy

    - by mrwayne
    Hi, I'm having a problem where i use the XAML serializer / deserializer for a configuration type file that i have. The problem that i'm getting, is that the XAML serializer is returning objects from the assembly in the /Bin directory, while the rest of the web application is using assembly's stored in the ..../Temporary Files/.. directory. Is there any way to prevent this from happening? Is this a bug in the XAML serializer / assembly loading routines? Every time i compile i need to stop and start the asp.net application so the shadow copy and the bin are exactly the same file. Even when not making a change to the dll and recompiling still causes the problem. Any thoughts on how to get around this problem? Currently i've tried turning shadow copy off, but then i have the same problem of needing to shut down / start up the web app every time i compile. Help!

    Read the article

  • Silverlight 4 RichTextBox - can't restore Xaml with text containing curly braces

    - by fuzzyman
    We have a Silverlight application using the RichTextBox as a rich text editor for the user to create emails. We actually have our own serializer but essentially we are saving and restoring the Xaml. As far as I can tell it is impossible to restore any text containing curly braces. You can demonstrate this fairly easily by creating a RichTextBox and typing something similar to "{weird}" into it. Then take the .Xaml property of the textbox and set it on the .Xaml property of another textbox - kablooie. As we have our own serializer I have tried escaping the Text member of the Run elements with "". This makes no difference. I've tried replacing the braces with &#123; but that doesn't work either.

    Read the article

  • WPF - 'Relational' Data in XAML Using DataContext

    - by Andy T
    Hi, Say I have a list of Employee IDs from one data source and a separate data source with a list of Employees, with their ID, Surname, FirstName, etc. Is it possible in XAML only to get the Employee's name from the second data source and display it next to the ID, using something like this (with the syntax corrected)?.. <TextBlock x:Name="EmployeeID" Text="{Binding ID}"></TextBlock> <TextBlock Grid.Column="1" DataContext="{StaticResource EmployeeList[**where ID = {Binding ID}**]}" Text="{Binding Surname}"/> I'm thinking back to my days using XML and XSLT with XPath to achieve the kind of thing shown above. Is this kind of thing possible in XAML? Or do I need to 'denormalize' the data first in code, into one consolidated list? It seems like it should be possible to do this simple task using XAML only, but I can't quite get my head around how you would switch the DataContext correctly and what the syntax would be to achieve this. Is it possible, or am I barking up the wrong tree? Thanks, AT

    Read the article

  • Problems with XAML WPF 4.0 Editor in VS2010

    - by RTPeat
    Wondering if anybody else has found some very odd behaviour with the XAML/WPF 4 editor in VS2010. This only occurs if the project is using .NET 4. Whenever I tried to open a XAML document for editing, the window would appear to open for a split second and then vanish, but VS2010 would still list the window as open. The fault was eventually traced to having the "Reuse current document window, if saved" option under "Documents" in the "Environment" options checked. Once this was unchecked XAML 4 files opened as expected. As I said, this only appears to occur on projects targeted at .NET Framework 4 - those targeted at 3.5 worked without a problem, and the "Reuse current document window, if saved" appears to work fine on other files.

    Read the article

  • Template and Themes in WPF through Custom Xaml Files

    - by AKRamkumar
    I have an application where I give my user Widgets. Suppose my user wants to customize the layout of the widgets. For example, I have a clock that is green. In Xaml, to add an animation around the clock would be easy. How could i make it such that at runtime, my application reads a layout.xaml file. Loads it and parses all the gradients and xaml. But still be able to use my widget in there. EG <Layout> <Grid> <!-- Grid Definitions or Animations or Whatever--> <Clock/> <!-- They need to be able to simply use this and my applications needs to read this--> </Grid> </Layout>

    Read the article

  • XAML resources aren't loaded when calling from different project

    - by svick
    I have a WPF project with some styles in XAML in Application.Resources. This works perfectly fine. But when I open a window from this project from another one (this one is a console application), the resources from XAML aren't loaded. When I first tried it, I got a XamlParseException on StaticResource calls in XAML, so I changed it to DynamicResource and now the style just doesn't get loaded. How do I fix this? The code I use: [STAThread] static void Main() { App app = new App(); MyWindow wnd = new MyWindow (); wnd.Show(); app.Run(); }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >