All of the MenuItems do not inherit the color. Is there a way in WPF for me to set the color automatically from the main parent colors? Thanks.
I've just discovered that the Foreground property goes through all children. Background doesn't though. :(
...
Hello,
I am trying to create some custom treeviews. Everything is working fine so far, but I got a little problem with styles. I have a simple "RedBackground" Style which I add to the resources of the Window. When adding normal elements, it works fine.
When using a custom item template to render treeview items, my resource is ignored....
I have horizontal ListBox. Here is code for it (removed some irrelevant):
<ListBox Grid.Row="1"
ItemContainerStyle="{StaticResource ListBoxUnselectableItemStyle}"
ItemsSource="{Binding ...}"
BorderThickness="0"
Background="{x:Null}"
...
I have this class:
public partial class Window1 : Window
{
public String Name2;
public Window1()
{
InitializeComponent();
Name2 = new String('a', 5);
myGrid.DataContext = this;
}
And I want to display the string Name2 is a textbox.
<Grid Name="myGrid" Height="437.274">
<TextBox Text="{Binding Path=Name2}"/>
</...
Hi,
[EDIT] Solution in code can be found on bottom [/EDIT]
I am not sure if I am "thinking wrong". Assume I have a list box, and I want to add different stuff to this listbox. Of course, I know I could change the itemtemplate, add some data binding to it, to display my custom classes.
But this is to "special". I am looking for a way t...
How can I modify my Menu so that it shows the color all the way through and not like this:
Here is my code:
<DockPanel>
<Menu DockPanel.Dock="Right"
Height="30"
VerticalAlignment="Top"
Background="#2E404B"
BorderThickness="2.6"
Foreground="#FFAA00">
<Menu.Bi...
<MenuItem Header="Language" Background="#2E404B">
MenuItem.Icon>
<Image Source="MenuImages/speechbubble.png" Stretch="Fill" />
</MenuItem.Icon>
</MenuItem>
How can I make it so the bubble fits nicely into the square box? Or even better, is there a way for my text to be a bit lower to hit the middle of the image. I wou...
I want a attribute in my Hero class to have a Portrait attribute for his/her image. What object type should I use in this case?
public class Hero
{
public string Name { get; set; }
public string HeroType { get; set; }
public int StartingHP { get; set; }
public int StartingMana { get; set; }
public Dictionary<string, ...
Anyone have any suggestions on how to insert a row or column in a WPF Grid using (preferably) Visual Studio 2008?
It's no problem to add a new RowDefinition or ColumnDefinition, but I'm really not too excited about the prospect of incrementing the Grid.Row or Grid.Column for the large number of cells that are affected by the insertion. ...
Hi All,
I have several geometry meshes in my Viewport3D, these have bounds of (w:1800, h:500, d:25).
When a user clicks in the middle of the mesh, I want the Point3D of (900, 500, 25)...
How can I achieve this?
Thanks!
Mark
...
Given the following little snippet:
<Grid>
<Frame Width="300" Height="300" Background="Blue"></Frame>
<Frame Width="350" Height="350" Background="Red"></Frame>
</Grid>
as expected you don't get to see the blue frame (it being behind the red one).
However, if you include the source attribute to the blue frame:
<Grid>
<Frame Wid...
We're in the process of moving into WPF (going very nicely thankyou) and the last work I did with it was a couple of years ago so most of the books I've got from that time frame are little dated.
Has anyone got a list of "new" features for WPF that have been added since the v1 release? In many ways its the little stuff like stringformat...
In my surface application I have a SurfaceWindow with a SurfaceUserControl on. On the SurfaceUserControl I have a SurfaceButton but the ContactUp (and down) event is not fired. The ContactHoldGesture event is fired though.
Any ideas?
...
I have created an attached property to extend a Button class with additional state:
<Button v:ExtensionHelper.OperationMode="{Binding MyObject.OperationMode}" Command="{Binding MyObject.Select}" Style="{StaticResource operationModeControlTemplateStyle}" />
Then I want to acces this value in the controltemplate using Datatriggers like ...
Where could I find examples of PS 3.0 shaders used as ShaderEffects for WPF 4? I'm looking for tutorials, presentations, any resource on this matter.
...
I would like to know how to iterate through all the elements in a WPF Grid, and then access the absolute positioning values (X, Y) for all of these UIElements.
...
I have created nearly 40 to 60 button controls dynamically on canvas control using WPF. Now I want to remove the selected button control from the canvas. How do I do this.
...
Hi,
I have a simple question which is giving me some difficulty. I have downloaded a custom them for WPF of the net. Now i want to apply this theme to my App instead of the default one.
How do i do that, Do i do it in XAML or in Code ?
Thanks
Iffy
...
I have a custom control derived from Button:
class MyControl : Button{}
And suppose, this class is empty (has no members).
In the application's main window resources I use ResourceDictionary that contains styles for most WPF controls (so called theme):
<ResourceDictionary Source="BureauBlue.xaml" />
So, all controls on the...
Hi,
Does anyone know how to create a wpf Style in code behind, I can't find anything on the web or MSDN docs. I have tried this but it is not working:
Style s = new Style(typeof(TextBlock));
s.RegisterName("Foreground", Brushes.Green);
s.RegisterName("Text", "Green");
breakInfoControl.dataTextBlock.Style = s;
Cheers,
James
...