xaml

WPF: Adding an element to a databound Collection (a Dependency Property)

I have this DependencyProperty which holds an entity with a property that is a collection (ShoutBox.Entities): public static readonly DependencyProperty ShoutBoxProperty = DependencyProperty.Register("ShoutBox",typeof (ShoutBox),typeof (ShoutBoxViewerControl)); public ShoutBox ShoutBox { get { return (ShoutBox) GetValue(ShoutBoxPro...

How to know when a xaml element is finished loading

I have a custom control I'm developing that has a collection of items. When adding an item to the collection you're meant to do: myCustomControl.BeginAddItems(); myCustomControl.Items.Add("a"); myCustomControl.Items.Add("b"); myCustomControl.Items.Add("c"); myCustomControl.EndAddItems(); If defining in xaml it would be: <MyCont...

Resize a shape object

In this question I talk about a star-shape: http://stackoverflow.com/questions/839843/reuse-path-object-in-xaml) <Path x:Name="NiceStar" StrokeThickness="10" Stroke="#ff000000" StrokeMiterLimit="1" Data="F1 M 126.578613,11.297852 L 162.373535,83.825684 L 242.412598,95.456055 L 184.495605,151.911133 L 198.167480,231.626953 L 126.578613,1...

What kind of cascading or multiple-style functionality do I have with XAML Styles?

I have a DockPanel with "StackPanel rows". I need each StackPanel row to get the same style, however, the FIRST StackPanel row which should get one addition style. In CSS I would do this using the cascading feature which I don't seem to have in XAML styles. Is it possible then to have multiple styles as shown in the pseudo code below? ...

How to get WPF DataBinding-to-an-object to work

In the following example I bind the XAML to a static object via ObjectDataProvider. When the user changes information, I want it to automatically reflect in the XAML. What I don't understand is: how do I perpetuate the object? do I have to create a singleton? in the click event, how do I access the "object that is being edited" eventu...

Does XamlWriter exist in Silverlight 3?

I'm trying to write out an object in Silverlight (2) as Xaml. http://www.codeplex.com/silverlightcontrib won't work for me because it's not a FrameworkElement that I'm dealing with. Does anyone know if XamlWriter exists in Silverlight 3? ...

Why is INotifyPropertyChanged not updating the variables in XAML?

I want to simulate data changing in the model and having that data be reflected in XAML. As I understand I need to implement INotifyPropertyChanged. However, in the following code example, XAML displays the data from the customer only once but the date and time never changes. What do I have to change in the following example to make X...

Fat Models, skinny ViewModels and dumb Views, the best MVVM approach?

Through generous help on this question, I put together the following MVVM structure which displays the changes of a model in real time in XAML (current date/time), very nice. A cool advantage of this set up is that when you look at your view in design mode of Visual Studio or Blend, you see the time ticking by, which means th...

Invalidate CollectionViewSource

Hi all, I've defined the following view: <CollectionViewSource x:Key="PatientsView" Source="{Binding Source={x:Static Application.Current}, Path=Patients}"/> Where Patient is the following property: public IEnumerable<Patient> Patients { get { return from patient in Database.Patients orderby patient.Lastname select p...

WPF: Trigger animations on elements by name from EventTrigger on a dynamically created control

I have a Grid inside of an ItemsControl's DataTemplate, so there will be many copies of this grid. I want a mouse click on the grid to trigger the storyboard of an element outside of the DataTemplate. For example, I would like to animate Transform properties of a named element that exists elsewhere in the Window. Let's say my DataTemp...

Silverlight Project -Expression Blend

Is there a way to apply bitmapeffects within a silverlight web project. ...

WPF Stability in VS2008 Express

I'm having trouble with stability in the xaml editor. Restart VS 25 times a day has become tedious. Are there strategies that would minimize the problem or an open source alternative that provides a visual display? Any help would be sincerely appreciated! I don't want to jump out the window but I will... I WILL! ...

Importing WMF (Windows Metafile) or any other vector file into a silverlight project

Is it possible to import WMF (Windows Metafile) or any other vector based file into a silverlight project? ...

How can I get a transparent background for a DataForm in Silverlight 3?

I can't seem to get a transparent background for a DataForm in Silverlight 3 beta. The code below is what I am trying but it only makes the background partially transparent. Is there something I can do to fix it? <Grid x:Name="LayoutRoot" Background="Orange"> <Border Background="Blue" Margin="100,0,0,100"/> <Controls:DataForm ...

WPF ListBox Selection Problem when changing an item

When changing the selected item in a ListBox, I'm getting a weird error where the changed item appears selected but I cannot deselect it or reselect it. Is there a way to fix this? Here's a sample app that demonstrates the problem. public partial class Window1 : Window { public Window1() { InitializeComponent(); ...

Layout of ComboBox items

Hi all, I have ComboBox item style as follows (simplified): <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="35"/> </Grid.ColumnDefinitions> <TextBlock Grid.Column="0" /> <Path Grid.Column="1" Style={StaticResource StarStyle}/> </Grid> The result is as expected. An...

Interactive 3D object in Surface

How to create a interactive 3D object in WPF? For example it can be a 3D Cube which can be rotated and with "tap" gesture for each side triggering different action. ...

Cannot load external ResourceDictionary

I'm trying to load an external XAML file using this code: <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/OfficeStyle;component/OfficeStyleWindow.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictiona...

Visual Studio 2008 Xaml Editor not working / disappeared

When I start up VS 2008 to work on a WPF / Silverlight App and open a XAML or XML file the XAML / XML editor is no longer working. The designer does not show up and intellisense is unavailable. It basically looks like a text file has been opened. ...

WPF simple tips-and-tricks?

I was fooling around with margins and padding and found that a negative value was acceptable and gives a nice effect in appropriate circumstances. For instance, if you have a border with a filled object and you want the filled object color to overrun the border. Anyone have any others? ...