xaml

Data binding to a UserControl in WPF

I have a UserControl that I want to participate in data binding. I've set up the dependency properties in the user control, but can't get it work. The uc displays the correct text when I call it with static text (e.g BlueText="ABC") . When i try to bind it to a local public property, it is always blank. <src:BlueTextBox BlueText="Feel...

How to disable drop on wpf webbrowser control

How can I disable dropping of files on a System.Windows.Controls.WebBrowser? From the documentation it would seem that this behaviour should be disabled by default as it is inherited from the UIElement.AllowDrop Property. However dy default I can drag and drop files on to a WebBrowser control. Further to this it seems I can't disable th...

How to animate visibility of a StackPanel in Silverlight to expand and collapse?

In my case, I would like the expand/collapse to happen from left to right and right to left respectively. The animation should happen when the visibility changes. Thank you. ...

Can't use WPF designer because can't find custom base window type in XAML, but code behind is fine

I am using a base Window class in a WPF project. In the code behind C# file the assembly to the base type is referenced and fine. In the XAML is looks like this: <MyNamespace:WindowBase x:Class="MyNamespace.Applications.UserInterface.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ...

WPF Image Formats and Binding

I have a project which requires be to convert an in memory System.Drawing.Bitmap into an in memory BitmapImage so I can bind the BitmapImage to an Image control via XAML. The problem I am running into is during the conversion the original bitmap gets shrunk and is very blurry. This is very bad because the original bitmap is a bar code ...

silverlight .xap packaging bug (references of reverenced assemblies)

I encountered this strange issue and was lost for several hours before i found something interesting about how the .xap is packaged. among several things, i came to know that if my project was named "References", it would not be included in the xap, and more strange was another problem that if my SL app is referenceing assbly1 project ...

Multiple instances of user control with a canvas causes exception in Silverlight

I have a user control that has a grid (the one you get automatically when you create a user control) and a canvas within that. <Grid x:Name="LayoutRoot" Background="White"> <Canvas x:Name="SurfaceCanvas"> </Canvas> </Grid> In the CS file, I've defined an "Items" collection. public ObservableCollection<TestItem> Items { ge...

where to put StateChanged triggers?

Hi, Where do we put the StateChanged trigger from expressionblend.codeplex.com ? <i:Interaction.Triggers> <sam:StateChanged Completed="True" StateName="BeforeUnloaded"> <... /> </sam:StateChanged> </i:Interaction.Triggers> the above code i tried gave me a compile error saying A value of type 'StateChanged' cannot be added to...

What features of WPF that are available through XAML are not available through C# (or VB, ...)

Is it possible to use all WPF functionality in C# (VB, ...)? Or is there any maybe advanced functionality that is not directly accessible from C#? (Maybe because it might not be accessible by public methods but rather internal.) ...

Is there any semantical difference between element property syntax and atrribute property syntax?

I thought that element property syntax and attribute property syntax have no big semantical difference. However, I found that there must be some difference. E.g. The following example just demonstrates a simple trigger: <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2...

WPF - Titled Border

Is there an equivalent in WPF to the Titled Borders that exists in Java's Swing framework? Below is a link that contains a screenshot of what I am looking for, and some very poor ASCII art. http://www.java2s.com/Code/Java/Swing-JFC/TitledBorder.htm -------TITLE-------- | | | | | | |_...

UI workbench to generates xml file

Hi, We have one custom ESB, which parses the config file to orchestrate different activities. I am thinking to create one UI workbench through which we can create or modify the existing config file to create or alter the activity flow. Basically, I am trying to simulate the what Visual Studio IDE does for us for Web forms or WPF but r...

Blend 4 trigger rendering not working

Ive got a really frustrating bug going on with Blend 4, when i edit a control template with triggers, if i switch to one of the triggers, the trigger changes are not shown in the design pane, its like ive turned off trigger rendering somehow Reproduction Steps Create a new WPF application in visual studio 2010 Open new solution in blen...

Image and TextBlock in WPF RibbonApplicationMenu

Hi, I need to put an image and text to WPF Ribbon Menu. I have tried few things but all I can get are empty buttons in Ribbon Menu. I am using .NET framework 3.5. Part of my not working code is here: <r:Ribbon.ApplicationMenu> <r:RibbonApplicationMenu Command="{StaticResource ApplicationMenuCommand}"> <r:RibbonA...

Problem with data binding in xaml through a RIA Domain Service

I have an entity framework with a many-to-many relationship between Customers and Contacts. I have generated a Domain Service Class and added the following method manually. public Customer GetCustomerById(int Id) { return this.ObjectContext.Customer.Include("Contacts").SingleOrDefault(s => s.Id == Id); } I now want to create ...

Removing left and right border sides from listbox datatemplate

Currently I have specified borders for all datatemplated items in my horizontal listbox which is fine because I DO want borders for all individual listboxitems, but I would like to remove the left border from the first item and the right border from the last item. Is this even possible? Xaml: <ListBox.ItemTemplate> <DataTemplate> ...

What exactly is "static" about a XAML static resource?

In what sense are XAML resources static? By XAML resources I mean things declared in a resource block and accessed with the {StaticResource resource-name} syntax. Do page resources behave as though they are static members on a page class? Or, were I to create multiple instances of a page class, would I get multiple instances of its res...

How to best disable multitouch on buttons in WPF?

I am working on a Surface application and I have a problem with multiple buttons getting pressed at the same time. I have a menu control with a few buttons. Some of them are bound to Commands that make the hosting window fade out the menu control and run something else, while some are just hooked up to EventTriggers that fade through di...

Silverlight 4 - binding between two datagrids, from blend 4

I have some issues with using databinding in silverlight 4 xaml pages, this is my problem: I have two data grids: <sdk:DataGrid x:Name="dgCodeCountry" Height="144" Margin="41,56,39,0" VerticalAlignment="Top" AutoGenerateColumns="False" ItemsSource="{Binding Collection}" > <sdk:DataGrid.Columns> <sdk:DataGridTextColumn Binding=...

Binding to ViewModel from XAML

Hi there, I am new to the MVVM model, so I would like some advice, the solution I'm using right now does not seem to work. Description: I have a Viewmodel containing an observablecollection of Customers, I display these in a grid with "Back" and "Forward" buttons. The grids datacontext is set to the SelectedCustomer which is a prope...