Hi
Yesterday I was trying to create a control with a partially transparent background,. I am writing this because what I thought was so straight forward, was not.
Here is a simple example:
1: <Grid>
2: <Button Height="23" Margin="94,103,109,0" Name="button1"
3: VerticalAlignment="Top">Button</Button>
4: <Border Margin="57,61,21,101" Name="border1"
5: Background="blue" />
6: </Grid>
When we run this example we will get the following:
Hi.
As the Headline says, I will show you how to make a Drag and Drop / Move Content control. for this example I will use a canvas and an Image. But you can easily make it more generic by using a Content Control instead of the image.
It is actually very simple, let’s start with the Xaml Code.
1: <Canvas Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" HorizontalAlignment="Stretch"
2: VerticalAlignment="Stretch" x:Name="ImageHolder" >
3: <Image Canvas.Left="0" MouseWheel="Img_MouseWheel" MouseMove="Img_MouseMove"
4: MouseDown="Img_MouseDown" MouseUp="Img_MouseUp" Panel.ZIndex="0"
5: Cursor="Hand" Canvas.Top="0" Height="150" Width="150" Source="sketch.jpg"
6: x:Name="Img">
7: </Image>
8: </Canvas>
As you can see we are using a canvas and an Image.
to implement the drag and move we will need to use the following events:
Hey all
Nothing interesting happened this month, Except the fact that we are very busy and have almost no time to write. We are hoping to change that.
We remind you that if you want to make a quick 30$ all you have to do is to drop us an good article, you can get more information on our Make Money Writing Articles Page
Here are Januarys Stats:
So far we have looked at the requirements for our fictional application and the data structure that goes with that, the application’s Model using a repository pattern , and URL Routing to provide friendlier URLs.
What we have covered so far really is just supporting code. In this post we’ll look the first of two parts that really hold our application together, the Controller. In the next post we’ll cover the View and how it ties into the Controller.
Hi
In my latest article I discussed Scrolling and Binding to large collections in WPF. We saw some disturbing behavior when binding a large collection to an ItemsControl. After Further Examination I found out very interesting things regarding that matter.
We saw that the application used about 500MB of Ram. Lets look at the code again:
We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution
Learn More