Click here to Skip to main content
15,896,606 members
Home / Discussions / WPF
   

WPF

 
QuestionHow to get the description of an item in RSS feeds Pin
Nekkantidivya5-Aug-09 3:10
Nekkantidivya5-Aug-09 3:10 
AnswerRe: How to get the description of an item in RSS feeds Pin
Michael Sync6-Aug-09 7:49
Michael Sync6-Aug-09 7:49 
QuestionBinding Listbox to list of object Pin
sunit_825-Aug-09 3:00
sunit_825-Aug-09 3:00 
AnswerRe: Binding Listbox to list of object Pin
Mark Salsbery5-Aug-09 6:22
Mark Salsbery5-Aug-09 6:22 
GeneralRe: Binding Listbox to list of object Pin
sunit_825-Aug-09 19:16
sunit_825-Aug-09 19:16 
GeneralRe: Binding Listbox to list of object Pin
Mark Salsbery6-Aug-09 6:46
Mark Salsbery6-Aug-09 6:46 
AnswerRe: Binding Listbox to list of object Pin
nizam babu30-Aug-09 22:43
nizam babu30-Aug-09 22:43 
QuestionSimple custom Control Question Pin
ErickTreeTops4-Aug-09 21:04
ErickTreeTops4-Aug-09 21:04 
Ok ..i built a simple custom control. A tranparent button. Some of you may have seen it.

<UserControl
	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"
	x:Class="GlassButton"
	x:Name="GlassButton" Width="100" Height="30">
	<UserControl.Resources>
		<ControlTemplate x:Key="GlassButton" TargetType="{x:Type Button}">
			<Grid x:Name="OuterGird">
				<Rectangle Margin="0,0,0,0" VerticalAlignment="Stretch" StrokeThickness="1" RadiusX="4" RadiusY="4">
					<Rectangle.Fill>
						<LinearGradientBrush EndPoint="0.369,0.21" StartPoint="0.675,0.774">
							<GradientStop Color="#9992C0E8" Offset="0"/>
							<GradientStop Color="#FF1E86DC" Offset="1"/>
						</LinearGradientBrush>
					</Rectangle.Fill>
					<Rectangle.Stroke>
						<LinearGradientBrush EndPoint="0.382,0.116" StartPoint="0.618,0.884">
							<GradientStop Color="#FF2511D8" Offset="0"/>
							<GradientStop Color="#FFABCCE8" Offset="1"/>
						</LinearGradientBrush>
					</Rectangle.Stroke>
				</Rectangle>
				<TextBox Margin="0,0,0,0" Text="{TemplateBinding Content}" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center" BorderThickness="0,0,0,0" Foreground="#FFFFFFFF" Background="#00FFFFFF" x:Name="ButtonTextBox"/>
				<Path Stroke="{x:Null}" Margin="8,3.712,5.029,8.122" Stretch="Fill" StrokeThickness="0" Data="M167.80889,10.198788 C168.06227,8.3587256 167.20925,7.2831486 165.45782,6.9550772 L19.671443,7.637693 C18.742518,7.708315 15.582248,7.6193257 15.429944,7.5239237 15.429944,7.5239237 12.279116,7.979001 12.279116,7.979001 11.119595,8.2070631 10.356582,9.1665193 9.9996476,10.875024 9.9996476,10.875024 9.8747544,13 9.8747544,13 L9.8557733,52.576677 C10.339993,53.918511 11.067782,54.510987 11.915916,55.079524 12.76405,55.648062 14.503288,55.148249 16.548011,54.66758 18.263785,47.574348 165.59877,4.0491713 167.80889,10.198788 z">
					<Path.Fill>
						<LinearGradientBrush EndPoint="0.513,1.002" StartPoint="0.517,-0.105">
							<GradientStop Color="#B2FFFFFF" Offset="0"/>
							<GradientStop Color="#19FFFFFF" Offset="1"/>
							<GradientStop Color="#77FFFFFF" Offset="0.382"/>
							<GradientStop Color="#33FFFFFF" Offset="0.658"/>
						</LinearGradientBrush>
					</Path.Fill>
				</Path>
			</Grid>
		</ControlTemplate>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot" Height="Auto" Width="Auto">
		<Button HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Content="what" Template="{DynamicResource GlassButton}" Background="#FFD4D0C8" x:Name="BaseButton" BorderThickness="0,0,0,0"  />
	</Grid>
</UserControl>


I want anyone who uses this control in their WPF project to be able to modify 3 properties on it
a) button text,
B) Button colour and
C) the degree of opacity.

Here in lies the problem i have read that you cannot change the values of a controltemplate. As you can see from the xaml above even the text normally found ontop of a button is held in a textblock deep inside the controltemplate.

Can some one show me how to expose these three properties of the control to a calling program

regards

Erick
AnswerRe: Simple custom Control Question Pin
#realJSOP4-Aug-09 22:45
professional#realJSOP4-Aug-09 22:45 
AnswerRe: Simple custom Control Question Pin
Mark Salsbery5-Aug-09 9:36
Mark Salsbery5-Aug-09 9:36 
QuestionWindows vista MenuItem Pin
yanairon4-Aug-09 3:47
yanairon4-Aug-09 3:47 
AnswerRe: Windows vista MenuItem Pin
Super Lloyd6-Aug-09 1:54
Super Lloyd6-Aug-09 1:54 
GeneralRe: Windows vista MenuItem Pin
yanairon9-Aug-09 1:15
yanairon9-Aug-09 1:15 
GeneralRe: Windows vista MenuItem Pin
Super Lloyd9-Aug-09 1:45
Super Lloyd9-Aug-09 1:45 
GeneralRe: Windows vista MenuItem Pin
yanairon9-Aug-09 3:21
yanairon9-Aug-09 3:21 
QuestionSlow WPF performance. Please Help Pin
Etienne_1234-Aug-09 0:56
Etienne_1234-Aug-09 0:56 
AnswerRe: Slow WPF performance. Please Help Pin
#realJSOP4-Aug-09 1:06
professional#realJSOP4-Aug-09 1:06 
GeneralRe: Slow WPF performance. Please Help Pin
Etienne_1235-Aug-09 2:32
Etienne_1235-Aug-09 2:32 
QuestionLINQ Pin
sunil.n.cs4-Aug-09 0:44
sunil.n.cs4-Aug-09 0:44 
AnswerRe: LINQ Pin
Michael Sync4-Aug-09 1:27
Michael Sync4-Aug-09 1:27 
GeneralRe: LINQ Pin
sunil.n.cs4-Aug-09 2:32
sunil.n.cs4-Aug-09 2:32 
GeneralRe: LINQ Pin
Michael Sync4-Aug-09 4:24
Michael Sync4-Aug-09 4:24 
GeneralRe: LINQ Pin
sunil.n.cs4-Aug-09 18:09
sunil.n.cs4-Aug-09 18:09 
AnswerRe: LINQ Pin
Pete O'Hanlon4-Aug-09 22:05
mvePete O'Hanlon4-Aug-09 22:05 
GeneralRe: LINQ Pin
sunil.n.cs4-Aug-09 22:52
sunil.n.cs4-Aug-09 22:52 

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.