Click here to Skip to main content
15,914,016 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF Control Properties in XAML Pin
thrakazog22-Jul-08 13:39
thrakazog22-Jul-08 13:39 
GeneralRe: WPF Control Properties in XAML Pin
Jammer22-Jul-08 13:50
Jammer22-Jul-08 13:50 
GeneralRe: WPF Control Properties in XAML Pin
thrakazog22-Jul-08 14:04
thrakazog22-Jul-08 14:04 
GeneralRe: WPF Control Properties in XAML Pin
chester22-Jul-08 14:10
chester22-Jul-08 14:10 
RantRe: WPF Control Properties in XAML Pin
thrakazog22-Jul-08 14:14
thrakazog22-Jul-08 14:14 
GeneralRe: WPF Control Properties in XAML Pin
chester22-Jul-08 14:15
chester22-Jul-08 14:15 
GeneralRe: WPF Control Properties in XAML Pin
Jammer22-Jul-08 22:26
Jammer22-Jul-08 22:26 
AnswerFound the Answer Pin
thrakazog23-Jul-08 14:03
thrakazog23-Jul-08 14:03 
To have your C# code change XAML properties at design time you need to create a separate DLL that talks specifically to the designer for your control. This DLL needs to be named [control name].VisualStudio.Design.Dll and deployed wherever your control.dll is.

Example:

    internal class Metadata : IRegisterMetadata {

        // Called to register design time metadata
        public void Register() {
            AttributeTableBuilder builder = new AttributeTableBuilder();

            //Task
            builder.AddCustomAttributes(typeof(Button), new FeatureAttribute(typeof(TaskProvider)));
            
            MetadataStore.AddAttributeTable(builder.CreateTable());
        }
    }




// class that will change the property
    class TaskProvider : Microsoft.Windows.Design.Interaction.PrimarySelectionTaskProvider
    {
        public TaskProvider()
        {
          
        }

        protected override void Activate(Microsoft.Windows.Design.Model.ModelItem item)
        {

           if (String.IsNullOrEmpty((String)item.Properties["StringProperty"].ComputedValue))
                item.Properties["StringProperty"].SetValue(Guid.NewGuid().ToString()); //sets the value in XAML

            base.Activate(item);
        }
    }

QuestionHow to bind Ilist IN another IList to listBox. Pin
chandra vempati22-Jul-08 4:57
chandra vempati22-Jul-08 4:57 
QuestionOne Object Data Provider - Binding two datagrid Pin
Michael Sync20-Jul-08 7:31
Michael Sync20-Jul-08 7:31 
AnswerRe: One Object Data Provider - Binding two datagrid Pin
Jammer20-Jul-08 10:47
Jammer20-Jul-08 10:47 
GeneralRe: One Object Data Provider - Binding two datagrid Pin
Michael Sync20-Jul-08 21:36
Michael Sync20-Jul-08 21:36 
GeneralRe: One Object Data Provider - Binding two datagrid Pin
Jammer20-Jul-08 22:52
Jammer20-Jul-08 22:52 
QuestionDragSource Event ... has it been removed??? Pin
Jammer20-Jul-08 1:38
Jammer20-Jul-08 1:38 
AnswerRe: DragSource Event ... has it been removed??? Pin
Mark Salsbery20-Jul-08 8:46
Mark Salsbery20-Jul-08 8:46 
GeneralRe: DragSource Event ... has it been removed??? Pin
Jammer20-Jul-08 10:49
Jammer20-Jul-08 10:49 
QuestionWPF and Texture mapping.. need some help =( Pin
SilverD20-Jul-08 0:51
SilverD20-Jul-08 0:51 
AnswerRe: WPF and Texture mapping.. need some help =( Pin
Insincere Dave21-Jul-08 7:39
Insincere Dave21-Jul-08 7:39 
GeneralRe: WPF and Texture mapping.. need some help =( Pin
SilverD24-Jul-08 7:30
SilverD24-Jul-08 7:30 
QuestionRead XAML file Pin
Krishnraj18-Jul-08 21:56
Krishnraj18-Jul-08 21:56 
AnswerRe: Read XAML file Pin
yanairon19-Jul-08 21:18
yanairon19-Jul-08 21:18 
GeneralRe: Read XAML file Pin
Krishnraj20-Jul-08 19:06
Krishnraj20-Jul-08 19:06 
QuestionHow to set the startup object in WPF? Pin
Michael Sync17-Jul-08 0:46
Michael Sync17-Jul-08 0:46 
AnswerRe: How to set the startup object in WPF? Pin
Wes Aday17-Jul-08 9:15
professionalWes Aday17-Jul-08 9:15 
GeneralRe: How to set the startup object in WPF? Pin
Michael Sync17-Jul-08 16:32
Michael Sync17-Jul-08 16:32 

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.