Click here to Skip to main content
15,917,060 members
Home / Discussions / C#
   

C#

 
QuestionHow to transfer Excel data sheet to an Access Table Pin
rameshika13-Jan-08 17:20
rameshika13-Jan-08 17:20 
GeneralRe: How to transfer Excel data sheet to an Access Table Pin
pmarfleet13-Jan-08 19:44
pmarfleet13-Jan-08 19:44 
GeneralRe: How to transfer Excel data sheet to an Access Table Pin
MickCurley14-Jan-08 1:13
MickCurley14-Jan-08 1:13 
GeneralRe: How to transfer Excel data sheet to an Access Table Pin
pmarfleet14-Jan-08 2:42
pmarfleet14-Jan-08 2:42 
QuestionWPF - Changing Fill property for group of shapes Pin
Shawn Horton13-Jan-08 16:25
Shawn Horton13-Jan-08 16:25 
GeneralRe: WPF - Changing Fill property for group of shapes Pin
CKnig14-Jan-08 0:46
CKnig14-Jan-08 0:46 
GeneralRe: WPF - Changing Fill property for group of shapes [modified] Pin
Shawn Horton14-Jan-08 7:06
Shawn Horton14-Jan-08 7:06 
GeneralRe: WPF - Changing Fill property for group of shapes Pin
CKnig14-Jan-08 18:46
CKnig14-Jan-08 18:46 
Shawn Horton wrote:
<usercontrol x:class="WpfCustomControlLibrary2.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" height="300" width="300"> <grid> <ellipse height="27" horizontalalignment="Left" margin="50,42,0,0" name="ellipse1" stroke="Black" fill="{Binding Path=SolidBrush, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" verticalalignment="Top" width="46"> <ellipse height="27" horizontalalignment="Left" margin="10,10,0,0" name="ellipse2" stroke="Black" fill="{Binding Path=SolidBrush, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" verticalalignment="Top" width="46"> <usercontrol>


And change the code behind to:


public static readonly DependencyProperty SolidBrushProperty = DependencyProperty.Register("SolidBrush", typeof(SolidColorBrush), typeof(UserControl1), new UIPropertyMetadata(null)); public SolidColorBrush SolidBrush { get { return (SolidColorBrush)GetValue(SolidBrushProperty); } set { SetValue(SolidBrushProperty, value); } }



This one should work but maybe you should change the DependencyProperty code to something like

<br />
            FrameworkPropertyMetadata metaBrush= new FrameworkPropertyMetadata(<br />
                    Brushes.Blue, FrameworkPropertyMetadataOptions.None);<br />
            SolidBrushProperty = DependencyProperty.Register("SolidBrush",<br />
                                                            typeof(SolidColorBrush),<br />
                                                            typeof(UserControl1),<br />
                                                            metaBrush);<br />

(I normaly define this in the static constructor of the class)

As you can see the only difference is the use of the initialised (Blue brush) FrameworkPropertyMetadata instead of a empty UIPropertyMetadata.
The rest looks fine to me.
GeneralRe: WPF - Changing Fill property for group of shapes Pin
Shawn Horton15-Jan-08 1:17
Shawn Horton15-Jan-08 1:17 
Generaldeveloping fingerprint software using c# Pin
ayie13-Jan-08 16:22
ayie13-Jan-08 16:22 
GeneralRe: developing fingerprint software using c# Pin
Vasudevan Deepak Kumar13-Jan-08 18:17
Vasudevan Deepak Kumar13-Jan-08 18:17 
GeneralRe: developing fingerprint software using c# Pin
ayie15-Jan-08 21:14
ayie15-Jan-08 21:14 
GeneralSp Pin
new2pgrmg13-Jan-08 16:09
new2pgrmg13-Jan-08 16:09 
GeneralRe: Sp Pin
tcsoccerman13-Jan-08 16:17
tcsoccerman13-Jan-08 16:17 
GeneralRe: Sp Pin
new2pgrmg13-Jan-08 17:06
new2pgrmg13-Jan-08 17:06 
GeneralRe: Sp Pin
new2pgrmg15-Jan-08 5:00
new2pgrmg15-Jan-08 5:00 
GeneralThe value of message box Pin
Strategic_Thinker13-Jan-08 5:27
Strategic_Thinker13-Jan-08 5:27 
GeneralRe: The value of message box Pin
tcsoccerman13-Jan-08 5:30
tcsoccerman13-Jan-08 5:30 
GeneralRe: The value of message box Pin
Strategic_Thinker13-Jan-08 7:00
Strategic_Thinker13-Jan-08 7:00 
GeneralRe: The value of message box Pin
Christian Graus13-Jan-08 9:20
protectorChristian Graus13-Jan-08 9:20 
JokeRe: The value of message box Pin
Steve Echols13-Jan-08 21:14
Steve Echols13-Jan-08 21:14 
GeneralRe: The value of message box Pin
Paul Conrad13-Jan-08 6:30
professionalPaul Conrad13-Jan-08 6:30 
QuestionVScrollBar and VisibleArea Pin
tcsoccerman13-Jan-08 4:08
tcsoccerman13-Jan-08 4:08 
GeneralRe: VScrollBar and VisibleArea Pin
Luc Pattyn13-Jan-08 4:55
sitebuilderLuc Pattyn13-Jan-08 4:55 
GeneralRe: VScrollBar and VisibleArea Pin
tcsoccerman13-Jan-08 5:28
tcsoccerman13-Jan-08 5:28 

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.