Hi,
I posted this question on the MSDN forum but haven't been able to receive much of an answer, so decided to try it out here.
I'm having a problem with dependency libraries of a project not being copied to the output directory of a second project that references it, when the first library is mostly xaml. Here is a typical scenario w...
Hi, i am building a context menu for a WPF c# application and just for simplicity's sake, if i have text and then i add an image, the text is always aligned at the top of the menu items cell and i cant figure out how to align it to the center. i have tried the veticalalignment property and veticalcontentalignment property but they dont h...
How to get the item double click event of listview?
...
I'm drawing a selection box when I click and drag on my canvas object (which extends Canvas).
I have overridden the OnRender method like so:
protected override void OnRender(DrawingContext dc)
{
base.OnRender(dc);
DrawGrid(dc);
DrawSelector(dc);
}
private void DrawSelector(DrawingContext dc)
{
if (Selecting)
{
dc.Dra...
Hi
I recently got it working to bind my XML document to my treeview by doing the following in the code behind file:
XDocument doc = XDocument.Load("path\\dsCurrent.xml");
_treeView.DataContext = doc;
and the following in the XAML:
<Window.Resources>
<HierarchicalDataTemplate ItemsSource="{Binding Path=Elements}" x:Key="TVTe...
The constructor of the RoutedCommand has "owner type" as a last argument. What is its significance? When it is used?
MSDN documentation gives completely no clue about why it's needed and whether I could use one type for all commands
Quote from MSDN
ownerType
Type: System.Type The type
which is registering the command.
The...
I have a WPF DataGrid with some data. You can add rows through a separate window. The DataContext is the same, a LINQ-to-SQL object. Binding is also the same, I bind the "ItemsSource" property to a table.
In the other window, when the user clicks on "Save", I create a row programatically and add it using "InsertOnSubmit". After that I u...
I'm experimenting with MVVM in the context of a simple WPF app. I have a Command attached to a button. If the text in a TextBox is 'incorrect', I want the TextBox to get focus and all it's contents selected. It seems the only way to do this is either through some kind of direct call from the Command in my ViewModel to the View, or set...
I am currently trying to make the WPF menu render vertically. I used the following code :
<Menu.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</Menu.ItemsPanel>
which is ok but I would like the submenus to show on left of each root menuitem.
any pointers on how...
I'd like to disable the multi-select feature of a checkbox in a ListView. How do I do that?
...
I have a control bound to an Object and all is well but I want to turn it into a control template bound to different objects of a similar type. I would like to do this exclusively in xaml, if possible. Any good tutorials that outline the steps?
<TextBlock Text="{Binding Source={StaticResource BorderControl}, Path=ControlName}"/>
EDI...
I'm using the M-V-VM pattern in WPF and I have a background brush I'm going to be using rather often and I'd like to move it out in to a shared ResourceDictionary.
The only problem is the brush uses a color which it gets via Databinding to its hosted context.
Is there anyway I can move the brush out in to a ResourceDictionary and still...
Given a StackPanel:
<StackPanel>
<TextBox Height="30">Apple</TextBox>
<TextBox Height="80">Banana</TextBox>
<TextBox Height="120">Cherry</TextBox>
</StackPanel>
What's the best way to space out the child elements so that there are equally-sized gaps between them, even though the child elements themselves are of different sizes? ...
Hi All,
Assuming I have this struct definition in C#:
public struct TimeSlotInfo
{
public int TimeSlotID;
public int StartMin;
public int CalcGridColumn;
public string BackgroundCol;
public bool ToDisable;
}
And I have a linq query as so:
var TimeSlotsInfo =
from ts in datacon.TimeSlots
select new TimeSlotInfo
{
Ti...
Hi, I am using an ObjectDataProvider and a DataTemplate to populate a MenuItem inside my Menu bar. (WPF, C#/XAML) See snipet below.
Result: The top menu item appears, when i click on it, the wrapping menu item (the one with the bound header text) appears along with the little arrow indicating the presence of children but hovering or cli...
I have Developed a WPF application in which iam adding images to the listbox. Now i want to move the images from one place to another in that listbox. for example - image which is in first position in a listbox has to move some fifth postion my dragging with mouse pointer.
Any suggestions plz.
Thanks in advance
...
Does anyone know the correct method for writing a destructor for an XBAP application?
...
I have developed a WPF Application with some buttons. Now i want to change the color of those buttons onmouseover,onmouseleave,onmouseenter by using triggers or any other events.
Any suggestion plz
Thanks in advance.
...
So I have a StackPanel that I am using as a ContentControl. I have a place where I want buttons to be generated based on data that I am binding to, and that is all working good, but I want the buttons to be laid out horizontally, not vertically as is what is currently happening. Here's a screenshot:
And here is the code from my Cont...
How can I convert a xaml to baml?
thanks
...