|
Go to the article search, if you haven't already done so, and check off WPF under technology and Skill level as Beginner, and many good stuff pop up. It may take sometime to digest it all, but I am sure you'll find it helpful along with the book Pete suggested. I've seen the book at Barnes and Noble and it is a very good looking book. The price on Amazon is good, too.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
There are two sites where you can download all type of books.
4shared.com
esnips.com
I found good WPF book "Pro WPF in C# 2008". A nice book worth for buying.
|
|
|
|
|
Hi,
I try to add Fonts to a ListBox in a Silverlight application.
I can take them from c:\windows\forms directory but they are'nt english.. I will use them in changing a TextBox's text property...
There is no System.Drawing dll for Silverlight... What can i do?
Sorry for my English.
|
|
|
|
|
You may use it like this:
textblock.FontFamily = "Comic Sans MS";
textblock.FontSize = "24";
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
Thanks for Reply!
But
I try to do: When client get page, all windows fonts must be binded to a listbox, then he can use all fonts from this list box.... also user can dynamically add own font to mentioned listbox.
|
|
|
|
|
You won't be able to access the system directory of client machine... Don't do that. Just use the static font list.. You can take a look some Rich Text Editor (Javascript or Silverlight). they don't show all fonts that are installed in client machine..
another thing: if you are using non-English keyboard, you may face some problems with Silverlight..
|
|
|
|
|
Hello everybody!
Maybe someone can help me with this (I'm new to WPF so don't expect too much from my side)
I have a Grid filled with several Items which inherit from Textblock:
public class MatrixElement : TextBlock
{
public int GridPositionX { get; set; }
public int GridPositionY { get; set; }
}
The GridPositionX and GridPositionY mark the Position inside the Grid.
Now I need to obtain the MatrixElement by clicking on it inside the grid:
private void grid_MouseRightButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
MatrixElement elem = ???;
}
If this has something to do with VisualTreeHelper please be so kind and explain it a little bit more.
Thank you in advance.
|
|
|
|
|
I think your on the right track, the VisualTreeHelper should do the job for you:
private void grid_MouseRightButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
MatrixElement elem = GetDependencyObjectFromVisualTree((DependencyObject)sender, typeof(MatrixElement)) as MatrixElement;
}
private static DependencyObject GetDependencyObjectFromVisualTree(DependencyObject startObject, Type type)
{
DependencyObject parent = startObject;
while (parent != null)
{
if (type.IsInstanceOfType(parent))
break;
else
parent = VisualTreeHelper.GetParent(parent);
}
return parent;
}
Hope this helps.
|
|
|
|
|
If the event is being raised by the Grid (which is what it looks like),there's no way that going up the tree will find the MatrixElement.
However, if what you actually clicked on was the MatrixElement, you should be able to use the e.OriginalSource property to get the element.
|
|
|
|
|
Thanks!
if (e.OriginalSource is MatrixElement)
{
MatrixElement elemnt = e.OriginalSource as MatrixElement;
}
this one works!
|
|
|
|
|
Hi
I have a textbox in which user can enter some text and then i am populating a list view from database what ever matche with the user input in the textbox.
I am getting the dataset and able to bind it to the list view. But i want to bold the particular field that exactly matches withe the input. is there any way to bold or highlight the particular field in a list view..
if any one knows the solution please help me..
Santhapur
|
|
|
|
|
|
Hi
I am familiar with one that you hvae Given..
but i want to change the view (Bold ) of the particular cell.. not the entire row..
If you can please help me
Santhapur
|
|
|
|
|
I was trying to solve this problem. In many ways I tried, but as per your requirement you have to add "TextBlock", then after that you can highlight the particular cell changing the Foreground colour.
|
|
|
|
|
hey thanks for u r idea. if u have any sample that will be a gr8 help for me
|
|
|
|
|
Now let us have a XAML file, where there is a listview where Employee data such as FirstName,LastName & EmployeeNumber is being populated. I assume you are retrieving data from you database when a specify condition is beieng satisfied such as when FirstName matches the condition. In this case you want to heighlight those cells.
In this case your XAML file looks like:
<ListView.View>
<GridView AllowsColumnReorder="true" ColumnHeaderToolTip="Employee Information">
<GridViewColumn Header="First Name" Width="100" >
<GridViewColumn.CellTemplate>
<DataTemplate>
<l:EditBox Height="25" Value="{Binding Path=FirstName}" Loaded="EditBox_Loaded"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Last Name" Width="100" >
<GridViewColumn.CellTemplate>
<DataTemplate>
<l:EditBox Height="25" Value="{Binding Path=LastName}" Loaded="EditBox_Loaded"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="ID" Width="50" >
<GridViewColumn.CellTemplate>
<DataTemplate>
<l:EditBox Height="25" Value="{Binding Path=EmployeeNumber}" Loaded="EditBox_Loaded"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
Now in your cs class
private void EditBox_Loaded(object sender, RoutedEventArgs e)
{
EditBox edtBox = sender as EditBox;
if (edtBox.Value.ToString() == "Yajnesh")
{
edtBox.FontSize = edtBox.FontSize + 4;
}
}
I have tried to paint the background, but it is not straight forward as you have to use the concept dependency property.
|
|
|
|
|
Sorry this is not the complete solution. I will post an article having this functionality today.
|
|
|
|
|
My deadline is verysoon. please post it as soon as possible. plz help me
|
|
|
|
|
|
Thanks for your article ... but i am binding it to a Ilist collection not to a table and i wont get the single result i will get a multiple result set.
Aslesh
|
|
|
|
|
OK now your problem is mine as I am stuck at this point. I am also trying to bind a collection to this ListView at runtime & to highlight the search. End point is that in "EditBox_Loaded" method we can highlight it. You try how to bind the data collection at run time, as well as I am trying on my end.
|
|
|
|
|
Hi Please go through the zip file of my article the solution for collection class is there.
|
|
|
|
|
U did not perform any search right? u r just binding the listview to the collection .. is n't it ?
|
|
|
|
|
hi,
I have a textbox in which user can enter some text. when user stop typing for a while then it should trigger a method...
If anyone knows the solution please help me..
Aslesh
|
|
|
|
|
I see you found the WPF forum in the end ?
Just set a timer when the user presses a key. Reset it every time they press it, so it only fires when they have not typed for a while.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|