|
Why not write a good article about it?
|
|
|
|
|
It's possibly too short for an article, which was why I suggested a blog entry (with a suitable link here of course).
|
|
|
|
|
Given the quality problem lately, I would think, as long as it was good content, we could do with a nice short (but good) one
Since I have been learning WPF I have been making myself understand the different ways to do things, both in XAML and in the code behind so that might help make the article sufficient length and have some good content.
|
|
|
|
|
Here's a XAML version that underlines the text when the mouse is over the label. By default, the effects are removed when the mouse leaves the area, so you don't need to handle the leaving events.
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel>
<TextBlock>Font underline sample.</TextBlock>
<TextBlock x:Name="myLink" Text="Click here">
<TextBlock.Style>
<Style>
<Style.Triggers>
<Trigger Property="TextBlock.IsMouseOver" Value="True">
<Setter Property="TextBlock.TextDecorations" Value="Underline" />
<Setter Property="TextBlock.Foreground" Value="Blue" />
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
</Page> All that you need to add is the click event handling.
|
|
|
|
|
Thanks for this XAML. That will help me a ton in addition to knowing how to do it in procedural code.
|
|
|
|
|
can any body tell me how to Translate ellipse from its click event
Note: ellipse parant is grid
|
|
|
|
|
An ellipse doesn't have a click event.
Here's the closest example I can think of, using the MouseLeftButtonDown event:
<Grid Width="200" Height="200" Background="White" >
<Ellipse Width="100" Height="100" Stroke="SteelBlue" StrokeThickness="4" Fill="Aquamarine" MouseLeftButtonDown="Ellipse_MouseLeftButtonDown" >
<Ellipse.RenderTransform>
<TranslateTransform x:Name="EllipseTranslateTransform" />
</Ellipse.RenderTransform>
</Ellipse>
</Grid>
private void Ellipse_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
EllipseTranslateTransform.X = 30;
EllipseTranslateTransform.Y = 30;
}
What are you trying to do?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Do you experience sound echo problems when running in full screen mode? I get this in both Firefox and IE. If so, is there a workaround?
Kevin
|
|
|
|
|
No problems with echos either in window or full screen mode on channel 9 videos...have you tried checking your sound card control panel for weirdness?...I know soundblaster has this 'what U hear' thing that uses the speaker out as a recording input.
|
|
|
|
|
I only get this with Silverlight, not with other video types. I haven't checked out Silverlight videos outside Channel9 recently to see whether it's a general problem.
Kevin
|
|
|
|
|
I only keep my system on plain jane stereo...maybe you have it set for 5.1/7.1 surround or something?
|
|
|
|
|
No problems experienced here.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I do encounter it but only when I am on RDP. If I run the video on my host machine, it runs perfectly.
Regards,
My Blog
My Articles
Computers are incredibly fast, accurate, and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination. - Albert Einstein
|
|
|
|
|
Hi .
I've created an UserControl, then I've added its DLL file to my references.
When I've pressed F5 it works, but I can't see the Design of my WPF APP in VS2008 SP1.
The following errors have occurred :
Error 1
Assembly 'CustomToolTip' was not found.
Verify that you are not missing an assembly reference.
Also, verify that your project and all referenced assemblies have been built.
D:\My works\C#\tooltip\WpfApplication1\WpfApplication1\Window1.xaml
4 21 WpfApplication1
Error 2
The type 'myToolTip:UserControl1' was not found.
Verify that you are not missing an assembly reference and that all
referenced assemblies have been built.
D:\My works\C#\tooltip\WpfApplication1\WpfApplication1\Window1.xaml
21 10 WpfApplication1
By the way, I've tried Blend2 , with it I can see the Design of my App without any problems.
this is my App XAML code :
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:myToolTip="clr-namespace:CustomToolTip;assembly=CustomToolTip"
Title="Window1" Height="600" Width="800">
<Grid x:Name="rootGrid" RenderTransformOrigin="0.5,0.5">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform x:Name="rootGridXY" X="0" Y="0"/>
</TransformGroup>
</Grid.RenderTransform>
<Rectangle Margin="26,34,496,374" Name="rectangle1" Stroke="Black"
Fill="Coral" MouseLeave="rectangle_MouseLeave" MouseMove="rectangle_MouseMove" />
<Rectangle Fill="Lavender" Margin="537,29,53,376" Name="rectangle2"
Stroke="Black" MouseMove="rectangle_MouseMove" MouseLeave="rectangle_MouseLeave" />
<Rectangle Fill="Peru" Margin="192,391,186,37.995" Name="rectangle3"
Stroke="Black" MouseMove="rectangle_MouseMove" MouseLeave="rectangle_MouseLeave" />
<myToolTip:UserControl1 UserControlTextBlockToolTip="Some texts"
UserControlToolTipTitle="Title"
Visibility="Hidden"
x:Name="customToolTip" />
</Grid>
</Window>
Could you guide me ?
Thank you
|
|
|
|
|
|
I have been looking over WPF lately as I am trying to make the decision if I am going to move in that direction and away from standard Windows Forms stuff. It seems to get me some very nice control rendering (where before I used to have to use owner draw junk) and the binding is looking far better than standard data binding...
The only thing that is starting to get to me, after looking over every video tutorial I can find and a ton of blogs (I have not bought a book YET but plan to soon) I am seeing a ton of repetitive markup in the xaml with respect to creating styles, templates, and other stuff that really looks to me like it belongs in a project wide scope similar to that of a CSS.
Is there a context for this? I have to assume there is... I get the feeling that you would be able to put the project wide stuff into the application.xaml file?
I can't wait to get a break from my last class work to try this stuff out...
|
|
|
|
|
You can put your application wide resources into a ResourceDictionary. You then link to the resource dictionary in like this (assuming you're placing it in App.xaml:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary Source="MyResourceDictionary.xaml" />
</ResourceDictionary>
</Application.Resources>
|
|
|
|
|
|
hi friends,
I've an user control in WPF. It looks like an image in 2-Dimensional (ex. a washer). i want to know how to change that control like a 3-Dimensional image control and that should be rotatable if we scroll with scroll bars.
can any one help me out in this?
Thanks & Regards,
-Ravi
|
|
|
|
|
As I explained when I answered to you the last time you asked this question[^], you can't convert a 2D image into a 3D image in WPF automatically. You need to convert the model into a 3D mesh using a 3D tool. You can get Blender[^] for free, and this outputs to XAML.
|
|
|
|
|
but to work on blender we need a guide.it's somewhat difficult to work with out guide
|
|
|
|
|
ravi.vellanky wrote: but to work on blender we need a guide.it's somewhat difficult to work with out guide
And there are tutorials on the site. Bottom line - if you're not working on an image that can be height mapped, you need to :
a. get a copy of the software and invest the time in learning it
b. hire somebody to do it for you
or
c. buy a prebuilt model
There are plenty of blender tutorials scattered all over the web, so there should be something to help you there.
|
|
|
|
|
HI all,
kindly i ask you the right way how allocate/distribute a Wpf application on more computer and connect to the server...i try to make me understand ,i will develop a software(app.exe) in Wpf with Linq toSql and Sql Server ,after develop it i will install the software on about 10 computers that of consequence would connect to the server to Add,Edit,Delete data and etc.etc. sincerely i don't know how work out/handle this step... i have not idea ,
i tried to search some information but maybe i wrong the subject of the research so i'm here to ask some useful advice to help my research ...if you need more details as me i will answer as soon as possible.
Thanks
Have a fun.
Bye
|
|
|
|
|
One way to do this would be to set this up to use ClickOnce[^] as the install mechanism.
|
|
|
|
|
HI Pete,
how are you?
I tried ClickOnce for create a file.exe of the software and to install it in another computer,meantime i get on my computer the server with Database(both computer are connect in Lan) i could install the application correctly but when i use the it to see or save a record it got stuck with an error that couldn't connect to the server.
Now i get a doubt where i must set up the option to allow the client app to connect to the server ???
or the error is caused from another source???
I read the topic on MSDN about ClickOnce but i did not see about how set up the server and so on...
However thanks a lot for your support
Have a fun
Bye
|
|
|
|