Click here to Skip to main content
15,894,540 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: About Silverlight Start Pin
Pete O'Hanlon2-Jul-09 21:40
mvePete O'Hanlon2-Jul-09 21:40 
AnswerRe: About Silverlight Start Pin
Mark Salsbery3-Jul-09 6:46
Mark Salsbery3-Jul-09 6:46 
QuestionWPF custom Control delete event name [modified] Pin
Vinod C S2-Jul-09 5:03
Vinod C S2-Jul-09 5:03 
AnswerRe: WPF custom Control delete event name Pin
User 2710093-Jul-09 13:49
User 2710093-Jul-09 13:49 
GeneralRe: WPF custom Control delete event name Pin
Vinod C S5-Jul-09 23:12
Vinod C S5-Jul-09 23:12 
GeneralRe: WPF custom Control delete event name Pin
User 2710096-Jul-09 1:43
User 2710096-Jul-09 1:43 
QuestionRe: WPF custom Control delete event name Pin
User 2710096-Jul-09 3:50
User 2710096-Jul-09 3:50 
AnswerRe: WPF custom Control delete event name Pin
Vinod C S6-Jul-09 4:23
Vinod C S6-Jul-09 4:23 
Hi Karl,
Thanks for ur reply.
I checked by implementing IDispose, but I didn't get notification in dispose();.
I found another way of doing this task, its by providing a PrimarySelectionTaskProviderfor the Window class:


    internal class FSFWindowTaskProvider : PrimarySelectionTaskProvider {

        /// <summary>
        /// Constructor
        /// </summary>
        public FSFWindowTaskProvider() {

        }

        /// <summary>
        /// This function wil be called when a control is selected in WPF window
        /// </summary>
        /// <param name="item">the currently selected control</param>
        protected override void Activate(ModelItem item) {
            ModelService service = Context.Services.GetService(typeof(ModelService)) as ModelService;
            service.ModelChanged += new EventHandler<ModelChangedEventArgs>(service_ModelChanged);
            base.Activate(item);
        }

        private void service_ModelChanged(object sender, ModelChangedEventArgs e) {
            // Get the removed Items from window
            IEnumerable<Microsoft.Windows.Design.Model.ModelItem> enumerator = e.ItemsRemoved;
            foreach (ModelItem mi in enumerator) {
                // Get the name of the control deleted
                MessageBox.Show(mi.Properties["Name"].ComputedValue.ToString() + "deleted");
                string cntrlName = mi.Properties["Name"].ComputedValue.ToString();
                if (string.IsNullOrEmpty(cntrlName)) {
                    continue;
                }
                // Write the clean up code
            }

        }
    }

       internal class Metadata : IRegisterMetadata {
....
 // Primary selection task provider for FSFWindow
                builder.AddCustomAttributes(typeof(myWindow), // mywindow is my custom class
                    new FeatureAttribute(typeof(FSFWindowTaskProvider)));
      } 


In service_ModelChanged, we will get the notification for control deletion.
GeneralRe: WPF custom Control delete event name Pin
User 2710096-Jul-09 4:29
User 2710096-Jul-09 4:29 
GeneralRe: WPF custom Control delete event name Pin
User 2710096-Jul-09 9:24
User 2710096-Jul-09 9:24 
GeneralRe: WPF custom Control delete event name Pin
User 2710097-Jul-09 21:47
User 2710097-Jul-09 21:47 
GeneralRe: WPF custom Control delete event name Pin
Vinod C S8-Jul-09 0:23
Vinod C S8-Jul-09 0:23 
QuestionPlease help DataTemplate Pin
Member 40708152-Jul-09 3:53
Member 40708152-Jul-09 3:53 
AnswerRe: Please help DataTemplate Pin
Pete O'Hanlon2-Jul-09 4:02
mvePete O'Hanlon2-Jul-09 4:02 
QuestionHow can i make Expander control to expand both side Pin
wasimsharp1-Jul-09 21:36
wasimsharp1-Jul-09 21:36 
AnswerRe: How can i make Expander control to expand both side Pin
User 2710093-Jul-09 13:52
User 2710093-Jul-09 13:52 
QuestionSet the margin for Listbox Pin
member271-Jul-09 21:34
member271-Jul-09 21:34 
AnswerRe: Set the margin for Listbox Pin
Pete O'Hanlon2-Jul-09 3:33
mvePete O'Hanlon2-Jul-09 3:33 
QuestionVisual Studio XAML Editor Hotfix Pin
Mark Salsbery1-Jul-09 8:21
Mark Salsbery1-Jul-09 8:21 
QuestionXAML Editor Hotfix Pin
Mark Salsbery1-Jul-09 8:20
Mark Salsbery1-Jul-09 8:20 
QuestionWPF StackPanel and Children Pin
Gianluigi831-Jul-09 1:28
Gianluigi831-Jul-09 1:28 
Questionhow to use &lt; in the XAML coding.. Pin
Hema Bairavan1-Jul-09 1:21
Hema Bairavan1-Jul-09 1:21 
AnswerRe: how to use &lt; in the XAML coding.. Pin
Pete O'Hanlon1-Jul-09 1:54
mvePete O'Hanlon1-Jul-09 1:54 
Questionchange selected index of System.windows.controls Combobox from javascript code + silverlight Pin
Member 39813661-Jul-09 0:44
Member 39813661-Jul-09 0:44 
AnswerRe: change selected index of System.windows.controls Combobox from javascript code + silverlight Pin
Michael Sync23-Jul-09 20:15
Michael Sync23-Jul-09 20:15 

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.