Click here to Skip to main content
15,888,461 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Custom link for install silverlight Pin
Arun Jacob7-Apr-10 1:17
Arun Jacob7-Apr-10 1:17 
QuestionError calling wcf service Pin
nitin_ion6-Apr-10 22:53
nitin_ion6-Apr-10 22:53 
AnswerRe: Error calling wcf service Pin
Arun Jacob6-Apr-10 23:05
Arun Jacob6-Apr-10 23:05 
GeneralRe: Error calling wcf service Pin
nitin_ion6-Apr-10 23:16
nitin_ion6-Apr-10 23:16 
AnswerRe: Error calling wcf service Pin
Abhinav S7-Apr-10 4:27
Abhinav S7-Apr-10 4:27 
GeneralRe: Error calling wcf service Pin
nitin_ion7-Apr-10 17:20
nitin_ion7-Apr-10 17:20 
GeneralRe: Error calling wcf service [modified] Pin
Abhinav S7-Apr-10 18:31
Abhinav S7-Apr-10 18:31 
QuestionCustomizing appearance of user-control property in 'Properties' panel [modified] Pin
Prasoon Chaudhary6-Apr-10 21:40
Prasoon Chaudhary6-Apr-10 21:40 
I've created a user-control to change border of an item. It is working fine with the following code. When the control is selected, this property appears under 'Miscellaneous' tab in 'Expression Blend/Visual Studio' Properties. But, to write value for this property, I need to type "Thick" / "Thin" etc. in space there. Can I define possible values as "Thick" / "Thin"/ "Thinner"/"None", so that they appear in a 'ComboBox'? Just like it appear in 'Visibility' and others?

I guess, this is something to do with 'TypeConverter'. I am new to C# and WPF. It would be nice, if reply comes with code for this specific problem, instead of generic one.

namespace Counters
{

	public partial class TestControl: UserControl
	{

		private string _borderType = "Thick";
		
		public TestControl()
		{
			this.InitializeComponent();
		}
	
	//
        //Add a property now :: BorderType
        //
        public static readonly DependencyProperty BorderTypeProperty = 
        DependencyProperty.Register("BorderType", typeof(string), typeof(TestControl),
        new UIPropertyMetadata("Thick", new PropertyChangedCallback(BorderTypeChangedCallBack)));

        public string BorderType
        {
            get { return _borderType; }
            set
            {
                _borderType = value;
				
				if (_borderType=="Thick")
				{
					//Code
				}
				else if (_borderType=="Thin")
				{

					//Code
				}
				else if (_borderType=="Thinner")
				{

					//Code
				}
				else if (_borderType=="None")
				{

					//Code
				}
				else
				{

					//Code
				}
            }
        }
		
        static void BorderTypeChangedCallBack(DependencyObject property, DependencyPropertyChangedEventArgs args)
        {
            TestControl textCounter = (TestControl)property;
            textCounter.BorderType = (string)args.NewValue;
        }

	}
}

modified on Wednesday, April 7, 2010 4:27 AM

AnswerRe: Customizing appearance of user-control property in 'Properties' panel Pin
Sevententh7-Apr-10 1:01
Sevententh7-Apr-10 1:01 
GeneralRe: Customizing appearance of user-control property in 'Properties' panel Pin
Prasoon Chaudhary7-Apr-10 1:17
Prasoon Chaudhary7-Apr-10 1:17 
AnswerRe: Customizing appearance of user-control property in 'Properties' panel [modified] Pin
Sevententh7-Apr-10 1:38
Sevententh7-Apr-10 1:38 
GeneralRe: Customizing appearance of user-control property in 'Properties' panel [Solved] Pin
Prasoon Chaudhary7-Apr-10 19:40
Prasoon Chaudhary7-Apr-10 19:40 
QuestionScrollbar on silverlight UserControl [SOLVED] Pin
#realJSOP6-Apr-10 8:10
mve#realJSOP6-Apr-10 8:10 
QuestionWPF Combobox Pin
koleraba6-Apr-10 8:04
koleraba6-Apr-10 8:04 
AnswerRe: WPF Combobox Pin
vsaratkar6-Apr-10 10:23
vsaratkar6-Apr-10 10:23 
GeneralRe: WPF Combobox Pin
koleraba6-Apr-10 12:01
koleraba6-Apr-10 12:01 
QuestionChanging Button Programatically [SLVED, but still accepting input/comments] Pin
#realJSOP6-Apr-10 7:49
mve#realJSOP6-Apr-10 7:49 
AnswerRe: Changing Button Programatically [SLVED, but still accepting input/comments] Pin
Pete O'Hanlon6-Apr-10 9:17
mvePete O'Hanlon6-Apr-10 9:17 
AnswerRe: Changing Button Programatically [SLVED, but still accepting input/comments] Pin
Michael J. Eber19-Apr-10 11:49
Michael J. Eber19-Apr-10 11:49 
QuestionChart ToolKit error in WPF Pin
Nanda_MR6-Apr-10 1:36
Nanda_MR6-Apr-10 1:36 
Questionwpf menu errors in XP Pin
hb521342145-Apr-10 13:24
hb521342145-Apr-10 13:24 
AnswerRe: wpf menu errors in XP Pin
hb521342145-Apr-10 13:54
hb521342145-Apr-10 13:54 
QuestionContext Menu Pin
ScottRadel5-Apr-10 12:09
ScottRadel5-Apr-10 12:09 
AnswerRe: Context Menu Pin
hb521342145-Apr-10 13:56
hb521342145-Apr-10 13:56 
GeneralRe: Context Menu Pin
ScottRadel6-Apr-10 8:21
ScottRadel6-Apr-10 8:21 

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.