I have implemented my own ScheduleDialogFactoryBase to have my own custom Appointment Dialog show (which is all well and good) but there are certain properties set on my custom Window which don't seem to get propagated through. As a result, I can't seem to set a Title on the AppointmentDialog, nor can I change the size of it.
Is there anything that can be done about this?
Thanks in advance.
Hi All,
Does anyone have a solution to this?
I can't believe this question has not been answered since March.
Thanks.
Steven
Hello,
I apologize for the late response. Our Schedule controls are setting their own size and title of the window. What you can do is to hook on the IsVisibleChanged event of the Window and to set your own title and size:
public class MyDialogFactory : ScheduleDialogFactoryBase { public override FrameworkElement CreateActivityDialog(FrameworkElement container, XamScheduleDataManager dataManager, ActivityBase activity, bool allowModifications, bool allowRemove) { Window window = new Window(); window.IsVisibleChanged += new DependencyPropertyChangedEventHandler(window_IsVisibleChanged); return window; } void window_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { Window window = (Window)sender; if (window.IsVisible) { window.Title = "My title"; window.Width = 200; window.Height = 300; } }
public class MyDialogFactory : ScheduleDialogFactoryBase
{
public override FrameworkElement CreateActivityDialog(FrameworkElement container, XamScheduleDataManager dataManager, ActivityBase activity, bool allowModifications, bool allowRemove)
Window window = new Window();
window.IsVisibleChanged += new DependencyPropertyChangedEventHandler(window_IsVisibleChanged);
return window;
}
void window_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
Window window = (Window)sender;
if (window.IsVisible)
window.Title = "My title";
window.Width = 200;
window.Height = 300;
Hope this helps!
Thanks,
Diyan Dimitrov
Thanks Diyan, that solved most of my queries.