I have an existing item which is a child of a canvas. The item's style is contained in a resource dictionary that contains the various brushes that can be used to color the item.
When an instance of the item is created it is given the default coloring. I am currently not able to directly interact with the Fill property as in:
item.Fi...
Hi there.
There are a bunch of properties to which you could provide a value in several ways. For example:
Style.TargetType: "ns:TypeName" vs "{x:Type ns:TypeName}"
Button.Command: "ns:TypeName.StaticPropertyName" vs "{x:Static ns:TypeName.StaticPropertyName}"
You name it.
The question is: are there any drawbacks which comes along w...
Hi,
I'm building a small WPF application. For the layout in the application, i use a grid with two columns and two rows. I want to have a background rectangle that fills the entire application, and I want the background rectangle to strech so if a user resizes the window, the rectangle streches and always fills the entire window. So ins...
I am trying to make the vertical stretch to work as expected i WPF, but for some reason it only takes the space it needs, and not the space available.
First, I am using WPF with C#, and Prism.
In the Shell.xaml (main xaml for the application) I have a grid with 2 columns and one row. The idea is to have a side panel and a main app are...
I've got a "popup" context menu on a list box, and there are two behaviors that would seem "out-of-the-box" but I am having a tough time getting the XAML ContextMenu to behave the way I would expect...
One is that, when I pick a sub-menu (e.g. "One" or "Two"), the initial menu continues to stay open (e.g. "Menu" does not go away once I'...
I'm using a WPF Expander to display a number of analog process variables.
I want to make the expander's border 'glow' (or flash) when one of these variables enters a 'warning' or 'alarm' state.
To achieve this, I'm using some data triggers bound to a couple of boolean properties in my view model ('AnalogWarningActive' and 'AnalogAl...
I have a class
public class Item
{
public string A { get; set; }
public Control B { get; set; }
}
I'm using MVVM with Silverlight. I have a custom view that is inherited from a standard view. Custom view has public property public ICollection MyItems { get; set; } which should store items described above.
In x...
Is it possible to edit a xaml icons or images in the expression design or using other tools?
Is it possible to import a xaml images (that e.g you have exported) in the expression designer for editing?
...
I have a class of MyClass<MyObject> and want to set it as the DataType for a HierarchicalDataTemplate.
What is the syntax for this in XAML? (I know how to set namespaces, I need just the
<HierarchicalDataTemplate DataType="{X:Type .....
syntax
...
Hello,
I want to know if the following in XAML is possible:
I have a FlowDocument used for printing. The FlowDocument is bound to a DataSource from which I get the current data. The data is a XML-Document which is also bound to an gui where the Data is inputted. The gui contains some comboboxes with a text-representation of the data-val...
I've seen how to bind a ComboBox to a list that has columns like this:
ItemsSource="{Binding Path=Entries}"
DisplayMemberPath="Name"
SelectedValuePath="Name"
SelectedValue="{Binding Path=Entry}"
but If I got a plain list with lets say countries in an 'ObservableCollection'
How do I bind to this?
I can't use 'DisplayMemberPath' since...
hi,
I'm using C# to create a FlowDocument and fill it with data within a table.
Example:
FlowDocument flowDoc = new FlowDocument();
Table table1 = new Table();
flowDoc.Blocks.Add(table1);
table1.RowGroups.Add(new TableRowGroup());
table1.RowGroups[0].Rows.Add(new TableRow());
TableRow currentRow = table1.RowGroups[0].Rows[0];
table...
Here's what I've done so far:
In my App class, I declare a new XmlDataProvider and set the source to a valid XML file (whose Build Action is set to Content/Copy Always).
public partial class App : Application
{
public App()
{
InitializeComponent();
var services = new XmlDataProvider();
services.Source =...
I have images scattered throughout my silverlight app, and because of the structure we decided on, all images are brought in from an HTTP URL.
Currently, in XAML an image would be declared as follows:
<Image Source="http://www.example.com/directory/example.png" />
I would like the base URL for all images referenced stored in a global...
I want to enable 'Apply' dialog button when content of some textboxes in this dialog changes.
Here what I came up with
<Window.Resources>
<ResourceDictionary>
...
<Style x:Key="SettingTextBoxStyle" TargetType="{x:Type TextBox}">
<Style.Triggers>
<EventTrigger RoutedEvent="TextBox.TextChan...
hi there,
i need to convert a large amount of icons in xaml format (all just use canvas) to bitmap format.
does anybody know about a tool that does that?
i only found xamltoys/xaml2emf this works but not correctly - colors are messed up and resolution is very low.
thanks!
...
I've used a control template to change the appearance of a button in a trivial way. It now looks different, but does not behave like a button. There are really two problems:
The button's command is never executed
After clicking on the button, it appears selected (i.e., the ellipse turns into an ugly blue rectangle)
Here's the gener...
I have a WPF application in which the main window's decoration is custom, via WindowStyle="None". I draw my own titlebar and min/max/close buttons. Unfortunately, Windows doesn't enforce my MinWidth and MinHeight properties when the window is resized, thus allowing the window to be resized all the way down to 3x3 (appx - just enough to s...
When i don't set background of my panel i can not get mouse events on that. why this behaviour?
I am able to get mouse events on panel by setting Background to Transparent which is null by default.
Whats the difference between Background null and Transparent?
...
Hi,
I'm trying to draw a hand-made DB drum alike shape. The problem is that the top ellipse is not completely filled.
Sample:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Image Width="126" Height="42" Margin="3" HorizontalAlignm...