Click here to Skip to main content
15,898,134 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How to return the value in Silverlight? Pin
Mycroft Holmes15-Feb-11 13:27
professionalMycroft Holmes15-Feb-11 13:27 
GeneralRe: How to return the value in Silverlight? Pin
Pete O'Hanlon16-Feb-11 7:37
mvePete O'Hanlon16-Feb-11 7:37 
GeneralRe: How to return the value in Silverlight? Pin
Tesic Goran17-Feb-11 1:27
professionalTesic Goran17-Feb-11 1:27 
GeneralRe: How to return the value in Silverlight? Pin
Tesic Goran17-Feb-11 3:18
professionalTesic Goran17-Feb-11 3:18 
GeneralRe: How to return the value in Silverlight? Pin
Pete O'Hanlon17-Feb-11 8:44
mvePete O'Hanlon17-Feb-11 8:44 
Questionwpf mvvm pattern Checkboxes to be checked by default. Pin
Himanshu0614198213-Feb-11 20:40
Himanshu0614198213-Feb-11 20:40 
AnswerRe: wpf mvvm pattern Checkboxes to be checked by default. Pin
Abhinav S13-Feb-11 21:15
Abhinav S13-Feb-11 21:15 
QuestionOpacityMask Brush Pin
HoltDan12-Feb-11 6:14
HoltDan12-Feb-11 6:14 
I'm trying to simulate a translucent tube with an object travelling through it. For simplicity, the tube is a rectangle and the object is a circle behind it.

I want the tube to be transparent in the middle and opaque on the edges so only the middle of the 'inside' object is clearly visible. I've got the tube's brush's OpacityMask set to a linear gradient - but it has no affect (can't see inside). I can lower the rectangle's Opacity property but that's not giving me the tube affect I'm looking for.

I'm using .NET 4.

Thanks,
Dan

<UserControl x:Class="SilverlightTest2.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
	<UserControl.Resources>
		<LinearGradientBrush x:Key="TubeBrush" EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="Black" Offset="0"/>
			<GradientStop Color="Black" Offset="1"/>
			<GradientStop Color="White" Offset="0.459"/>
			<GradientStop Color="White" Offset="0.604"/>
		</LinearGradientBrush>
	</UserControl.Resources>

    <Canvas x:Name="LayoutRoot" Background="White">
    	<Ellipse Fill="Green" Height="40" Canvas.Left="336" Stroke="Black" Canvas.Top="41" Width="40" OpacityMask="{StaticResource TubeBrush}"/>
    	<Rectangle Fill="Blue" Height="39" Stroke="Black" Canvas.Top="41" Width="360" OpacityMask="{StaticResource TubeBrush}"/>
    </Canvas>
</UserControl>

AnswerRe: OpacityMask Brush Pin
SledgeHammer0112-Feb-11 8:15
SledgeHammer0112-Feb-11 8:15 
GeneralRe: OpacityMask Brush Pin
HoltDan12-Feb-11 8:50
HoltDan12-Feb-11 8:50 
QuestionSilverlight or WPF Pin
Toniyo Jackson10-Feb-11 20:45
Toniyo Jackson10-Feb-11 20:45 
AnswerRe: Silverlight or WPF Pin
Mycroft Holmes10-Feb-11 21:06
professionalMycroft Holmes10-Feb-11 21:06 
GeneralRe: Silverlight or WPF Pin
Toniyo Jackson10-Feb-11 21:39
Toniyo Jackson10-Feb-11 21:39 
AnswerRe: Silverlight or WPF Pin
Abhinav S10-Feb-11 21:40
Abhinav S10-Feb-11 21:40 
GeneralRe: Silverlight or WPF Pin
Toniyo Jackson10-Feb-11 21:42
Toniyo Jackson10-Feb-11 21:42 
GeneralRe: Silverlight or WPF Pin
Abhinav S10-Feb-11 21:49
Abhinav S10-Feb-11 21:49 
AnswerRe: Access an Element using reflection Pin
Pete O'Hanlon10-Feb-11 11:58
mvePete O'Hanlon10-Feb-11 11:58 
GeneralRe: Access an Element using reflection Pin
Pete O'Hanlon11-Feb-11 3:23
mvePete O'Hanlon11-Feb-11 3:23 
GeneralRe: Access an Element using reflection Pin
Pete O'Hanlon11-Feb-11 9:08
mvePete O'Hanlon11-Feb-11 9:08 
AnswerRe: Access an Element using reflection Pin
dasblinkenlight10-Feb-11 15:20
dasblinkenlight10-Feb-11 15:20 
Questionmemory usage Pin
arkiboys8-Feb-11 23:11
arkiboys8-Feb-11 23:11 
AnswerRe: memory usage Pin
Pete O'Hanlon9-Feb-11 0:49
mvePete O'Hanlon9-Feb-11 0:49 
AnswerRe: memory usage Pin
Steve Maier9-Feb-11 4:27
professionalSteve Maier9-Feb-11 4:27 
GeneralRe: memory usage PinPopular
arkiboys9-Feb-11 5:25
arkiboys9-Feb-11 5:25 
GeneralRe: memory usage Pin
Steve Maier9-Feb-11 7:36
professionalSteve Maier9-Feb-11 7:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.