|
That worked perfectly. Thank you!
Everything makes sense in someone's mind
|
|
|
|
|
1) Anyone have a decent explantion of how Paths work? I have been researching it and it's still confusing.
2)
I found this example:
<Path Fill="SlateGray"
Data="M 2.5,5 l 10,0 l -5,6 Z" />
which draws a small down-facing arrow. How do you turn it so it's facing up?
Everything makes sense in someone's mind
|
|
|
|
|
I suppose it's easiest to explain how the Path statement works if we take your example.
First of all, let's see what M 2.5, 5 does? This moves the starting point to a point that is at 2.5, 1 relative to the owning container.
Next, l 10, 0 draws a line that starts at the point we specfied above, and ends at the point 10, 0.
Finally, l -5,6 Z draws the path from the point at 10, 0 and ends at -5,6. The Z tells the renderer to close the shape, so a line is drawn to the point that we started off with.
|
|
|
|
|
Thanks.
this[^]. Reading it now
Everything makes sense in someone's mind
|
|
|
|
|
Ok, I got it now.
BTW, is it possible to change a path using a trigger?
Everything makes sense in someone's mind
|
|
|
|
|
Of course it is. You'd have to supply a completely new Data if that's what you were trying to achieve, but it is certainly doable.
|
|
|
|
|
A path is a geometric representation of a figure.
For e.g M stands for move or startpoint. M or m can both indicate different things. V would mean a vertical line.
This[^] does explain the syntax in little detail - however, using Expression Blend is actually a much easier option to generate paths[^].
|
|
|
|
|
In my view I have a data template with a button in it:
<Button x:Name="SelectionToggle"
Command="{Binding SelectionToggleCommand, Mode=TwoWay}"
Grid.Column="1"/>
The output window shows that "SelectionToggleCommand" is not found on the model. How do I properly bind this command to the viewmodel?
Thanks
Everything makes sense in someone's mind
|
|
|
|
|
One of the wonderful thing about WPF is that Command properties can bind to any class that implements ICommand. Typical examples are Josh Smith's RelayCommand or PRISMs DelegateCommand. Suppose that you have RelayCommand, then you would hook it up like this:
private RelayCommand selectionToggleCommand;
public RelayCommand SelectionToggleCommand
{
get
{
if (selectionToggleCommand == null)
{
selectionToggleCommand = new RelayCommand(SelectToggle, CanSelectToggle);
}
return selectionToggleCommand;
}
}
private void SelectToggle(object o)
{
}
private bool CanSelectToggle(object o)
{
return true;
}
|
|
|
|
|
I get that much. The problem is that my XAML is in a data template and the message I get says it can't find the command on my data model.
So I need to tell my code to look on the data context, not the model.
Everything makes sense in someone's mind
|
|
|
|
|
Without knowing how and where your DataTemplate is linked in, I can't offer too much other than to say you really need to look at using a RelativeSource to find the element you are interested in to get the DataContext from.
|
|
|
|
|
i need good website to learn silverlight3.0 can anyone suggests me?
|
|
|
|
|
|
just i wanna learn about silverlight3.0 so, i need your suggestion..
|
|
|
|
|
Why do you want to learn Silverlight 3? It's at version 5 now, and it's way ahead in terms of functionality.
|
|
|
|
|
actually i just need to know all the difference between silverlight versions thats why? i knew about earlier versions..
|
|
|
|
|
If you are very new to the language, going through a book would be a better bet.
|
|
|
|
|
Hi All,
I need C1Flexgrid for WPF to be used as a usercontrol in my windows application project. I tried to do by inheriting the C1Flexgrid for WPF, but created user control is not listing in the toolbox. When I inherited normal DataGrid, its working fine. Can anyone help me out from this problem.
Thanks and Regards
Greeshma
|
|
|
|
|
I am thinking of doing an article on Silverlight treeview (I know done to death but I like to think I have an interesting take on the design) and was thinking of the bits required. I would probably use AdventureWorks for the data. Now here is the stray thought!
WCF services are pretty much a no brainer, especially if you only want to supply select functionality, so why does Microsoft not set up a public WCF to service all the demo/article/sample requirement for AdventureWorks. Allow anyone to get a List<> of any table or view in the database.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Thank you, presumably this is exactly what I was looking for, a WCF of the AdventureWorks data.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi, I am using the following code below to save and load the changes a user makes to shapes on a canvas (called 'myCanvas'). So I use the XamlWriter to save the entire Canvas to a file and the XamlReader to read. The XamlWriter writes appropriately but after calling the XamlReader the Canvas does not update with the saved content.
Am I missing a step?
private void Window_Loaded(object sender, RoutedEventArgs e)
{
FileStream fs = new FileStream("savedproperties.xml", FileMode.Open);
myCanvas = (Canvas)XamlReader.Load(fs);
}
private void Window_Closed(object sender, EventArgs e)
{
FileStream fs = new FileStream("savedproperties.xml", FileMode.Create);
XamlWriter.Save(myCanvas, fs);
}
|
|
|
|
|
Please how can I Fill a shape with horizontal or vertical lines only.
|
|
|
|
|
|
Thanks for your suggestion, Abhinav, though it didn't really help. But I guess that's because I still need to understand some graphics/wpf basics.
|
|
|
|