6 ביולי 2009
In WPF you get scrolling support by wrapping the content control you want to add scrolling to with the ScrollViewer content control.<ScrollViewer>
<TextBlock LineHeight="20" Grid.Row="0">
It adds a disabled scroll which changes to enabled if the content has overflowed the size of it’s container.
You may use the VerticalScrollBarVisibility="Auto" property of the ScrollViewer if you wish the scrollbar to appear only when enabled (it’s default state is Visible) and use HorizontalScrollBarVisibility="Visible" when the horizontal scrollbar is what you need.
ScrollViewer class holds several methods that allow you to programmatically scroll the content.
30 ביוני 2009
WPF Grid Shared Size Groups
The Grid rows and columns are given a direct size by the developer or are automatically sized by their content’s size. By using shared sized group feature you may also set the size of the rows or columns by the size of a different row/column at the current grid or from a different grid available in the page.
For example, you may set the column width of column 2 by the column width of column one at the same grid. You may also set the column width of column 2 at grid 2 by column 1...
24 ביוני 2009
XAML special characters and white spaces
Some beginner stuff i found a lot of people do not know about.
XAML is based upon the rules of XML. What this means is that characters such as ‘&’, ‘<’, ‘>’ and ‘”’ have their own meaning in XML and the XAML parser will understand them differently then what you intended them for. If you wish your button’s content to look like this <I am a Button> then you must change your XAML text to <Button Content="<I am a Button>"></Button> which creates a button like this:
Other character replacements are (don't forget the ‘;’)...
22 ביוני 2009
Oracle SQL performance booster
I want to share with you one of the best performance boosters i had come across.
In most of the applications i was working on (in the past and present) we did not use datasets, but built our own custom objects. The data access layer usually consisted of calls to stored procedures, functions and code generated SQLs all going through the MS data access application block.
Calling stored procedures and functions was easy enough, we used the generated SQL only when we needed to insert large amount of data (fields) which was easier done through generated SQL.
17 ביוני 2009
Scrolling Text animation in WPF
In one of our WPF applications we came across the need to present static data that is larger then it’s container (grid/text block/panel). We could have chosen to reduce the font size, but this was inappropriate for our situation because the application was intended to appear on a LCD screen and be seen from as far as possible.
We decided to present the text inside a text block and scroll it (bottom to top) if it became too large for the text block.
After quite a few trail and error attempts we succeeded in creating the required...
15 ביוני 2009
Look here at these awesome 3D WPF samples.
Josh Smith shows what you need to add cool 3D abilities to you application.
14 ביוני 2009
How to fetch remote session’s information on a terminal server
First a confession, i did not plan to start my first posts writing about TCP,Terminal Servers and their likes, but once i begun, i realized there is so much information i gathered that i just must share.
In this post i will show how to fetch additional information about the session the current process is running under in a terminal server. It is mainly based upon a previous post “Using terminal services API to determine if the application is being run remotely”.
We first need to to get the terminal server’s...
10 ביוני 2009
How to find an available port in C#
As i discussed in my post Development considerations taken when installing client application on a terminal server, there will be times you will have to find an available port yourself, without relying on WCF to do that for you.
This can be achieved by locating all ports currently used in your machine and returning the first port number that is not being used. The machine in question can hold open ports in different communication protocols and states(learn more about TCP and UDP):
Active TCP connections – TCP connections that are currently active, opened and connected...
9 ביוני 2009
Using terminal services API to determine if the application is being run remotely
Imagine you have a client application that may be executed remotely or locally at the user’s computer. For most times, you will need to know whether the instance of the application is being run directly on a user’s desktop or from a remote client machine.
You will need to be aware of this for several reasons, some of them were mentioned in my previous post Development considerations taken when installing client application on a terminal server.
This can be achieved by playing a bit with terminal services API.
7 ביוני 2009
Development considerations taken when installing client application on a terminal server
Installing client applications on terminal server has become more and more common for a few years now.
It holds many benefits including:
Cutting down hardware costs (less hardware needed).
Only one installation is needed for numerous clients (the number of clients that can run on a terminal server is subject to the client’s resources consumption).
Better application maintenance.
and many more…
When installing client application on a terminal server we need to take the following considerations into account:
The app.config file is now shared by many instances of the same program....