Ads by Google

Donate

If you like articles and you want an increase of them, please make a little donation. If you make a donation you can submit us by mail an argument for next articles!

Importo: 

add RSS

Add to MyYahoo!
Subscribe in NewsGator Online
Add to Newsburst
Add to Google
Add to My AOL
Add to Pluck
Subscribe in FeedLounge
Add to Windows Live
Add to NetVibes
Subscribe in Rojo
Subscribe in Bloglines
Add to MyMSN
Add to Plusmo for your cellphone
Add to PageFlakes
Add to Technorati

Subscribe to Blog

Follow us on Twitter

follow us

Manfriday blog gadget

WPF

Finally the WPF Ribbon has been released officially by Microsoft. This very powerful component will allow to develop modern applications easily .

Will be also available a new project template in Visual Studio and Expression Blend.

 

This is a interesting introduction to the WPF Ribbon

Enjoy yourself...

 

Bye bye and happy holidays

 

 
Blend 4 news, PathPanel Bug ?

the Blend 4 RC is now available and it brings a lot of news. It's incredible the amount of new controls, shapes and behaviours that microsoft introduced. 
I think that they leveraged the MVVM pattern in the right way, now designers can start to go deeply with events in a MVVM application too. Yes, because for a designer was impossible to approach to command world, but now with the new set of attached behaviours and actions is really simple to target events and handle them without write down code.
 
 
 An other amazing feature is the PathListBox ... infact you can bind the layout of a list box to a geometrical shape : an ellipse, a path or something else.
this produce awesome effects in your application.. here an example of Pathlistbox from xaml ninja
 
 
 
An other very useful control is the PathPanel that allows to you to define your own itemscontrol and use the pathpanel as ItemsPanel, unfortunately I discovered that the OrientToPath property doesn't work as expected. Probably the PathPanel will be removed in the RTM version of WPF 4, I hope that it will come back soon.
 
 
DataGridComboBoxColumn Binding
Domenica 25 Ottobre 2009 13:58
 
I want show you a great hack by Joel on computing to fix a bug of DataGridComboBoxColumn binding. 
using this class instead of DataGridComboBoxColumn  you will be able to apply binding to this column type.
 
This is the elegant solution of Joel 
 
public class DataGridComboBoxColumnWithBindingHack : DataGridComboBoxColumn
    {
        protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
        {
            FrameworkElement element = base.GenerateEditingElement(cell, dataItem);
            CopyItemsSource(element);
            return element;
        }
 
 
WPF Printing
Domenica 25 Ottobre 2009 13:04

Printing with WPF is very simple and amazing . We were used to do that whit GDI, where you need to draw every single element. Instead with wpf you can print directly an user control in a single page.
Let's see how to do that.
 
private void InvokePrint(object sender, RoutedEventArgs e)
        {
            // Create the print dialog object and set options
            PrintDialog pDialog = new PrintDialog();
            pDialog.PageRangeSelection = PageRangeSelection.AllPages;
            pDialog.UserPageRangeEnabled = true;

            // Display the dialog. This returns true if the user presses the Print button.
            Nullable<Boolean> print = pDialog.ShowDialog();
            if (print == true)
            {
                
 
DataModel for interactive DataGridCheckBox
Lunedì 05 Ottobre 2009 22:49

Hi there, it has been an hard period for me, but now I can write again

something that I hope will be useful.

 

Speaking about WPF Datagrid, we saw how it's easy to have a DataGrid CheckBox

Column type inside our Datagrid.

What it's not so easy is create a external checkbox to perform the SelectAll function...

 

Why ? that because of WPF Datagrid is a presentation layer and it's not a good idea

to access data from that.

Behind the Datagrid you always need a DataContainer for manage your data, then you

can bind DataGrid on that.

DataTable is the most large used, but a List is suitable too.

 

DataTable is great to load data from a DB and maybe make some filter using LINQ,

but if you need of something that automatically update your DataGrid when data changes

probably the best choice is to implement a custom class implementing INotifyPropertyChanged.

 

 
WPF datagrid scroll with selectionchange
Venerdì 10 Luglio 2009 01:40

With a little piece of code, you can realize a search tool to scroll a datagrid on the searched item!! Adding an handler to the textchanged eventi in TextBox control you can search all rows that have a secified field that start with textbox text. The scrollviewer leverage this function with a nice final effect...very fast!

 

 
TreeView as DataGrid RowDetail
Venerdì 10 Luglio 2009 01:19
If you have very complex data to arrange in a datagrid, you can use a TreeView as Rowdetail of a DataGrid row.
 
 
In the following example I stored main info in datagrid columns.
 
Then I enabled this function of the datagrid to be able to view additional infos when a row is selected.
 <my:DataGrid RowDetailsVisibilityMode="VisibleWhenSelected">
 
 
WPF toolkit datagrid xaml
Venerdì 10 Luglio 2009 01:03
Here an example about how to build a custom datagrid using WPFtoolkit datagrid control. Is really simple... you have to define columns templates using prebuild types or custom types.
 
You can use TextColumn, ComboColumn, etc... or you can build by yourself a custom column template , for example a buttoncolumn or a checkboxcolumn... look at the following xaml.
 
There are also nice skin features like AlternatingRowBackgroud..very cool.
 
Speaking about the binding, you can set by code the itemsource of the datagrid with a DataTable.DefaultView and the job is finished!! Then you only need to bind each field with the exact column using the Path property.
Anyway if you don't need of custom templates for columns, you can use AutoGenerateColumns to automatically bind datagrid columns with datatable ones.
 
 
 
 
WPF Digital Display
Venerdì 20 Febbraio 2009 20:57
 
 
 
We are going to see how to build a digital display with WPF. A digital display could be embedded in many types of application and control ( for example a gauge control ) .
 
It's very easy, the first step is to make two images to compose a digital number. Only 5 minutes with gimp.
 
barretta.png and barretta2.png   
 
 
Then we build a UniformGrid where the number of column is the number of digits of your display.
Now each digit will be build with 7 images. I built a columns and rows schema with relative values into a grid where I put images, so the resizing is not a problem anymore.
   
In the example I wrote the code only for one digit. The name of each images start with "dm" that is used to identify the digit that they belong to, we will see what is its use later. The rest of image name is an identifier of the position into the digit composition.                
       --- top
     sxtop  |   | dxtop
       ---  med
       sxbot  |   | dxbot
         ---  bot
 
 
Routed events
Lunedì 26 Gennaio 2009 20:12
Routed events in WPF are necessary because of XAML structure nature, infact events are routed through a tree of elements.
This is a new situation that never before existed in classical .NET UI. 

There are three types of routed events : 
-Tunneling : it propagates events from the top of the tree towards the the bottom.
-Bubbling : it's the same of tunneling but with opposite direction.
-Direct : this represents the typical .NET approach. 

Classical mouse events ( MouseLeftButtonDown, MouseLeftButtonUp) belong to Bubbling model, but there are others events like
PreviewMouseLeftButtonDown or PreviewMouseLeftButtonUp that are part of tunneling model. The prefix "Preview" denotes this feature.
To obtain the propagation you have only to assign an handler for each element of the tree to a specific events

ex.

<Grid MouseLeftButtonDown=”MouseDownGrid
Width=”300
Height=”200”>
 
 
WPF 3D Cube - 2
Giovedì 11 Dicembre 2008 23:07

In this second article about the 3D Cube we are going to implement the code behind.
 
the first step is the function private void cubeButtonClick(object sender, RoutedEventArgs e) referred to <Button Name="cubeButton" Click="cubeButtonClick">Cube</Button>
So when we click "Cube button" on the User interface we have to build the Cube. To build the cube we need 8 Point3D, so if we want a cube centered on origin we have to put
following values. Now with these points we proceed to create 6 surfaces.

 
 
<< Inizio < Prec. 1 2 Succ. > Fine >>

Pagina 1 di 2
Ricerca personalizzata