Hi
private
void btnStart_Click(object sender, RoutedEventArgs e)
{
ScanBusyInd.IsBusy =
true;
var bw = new BackgroundWorker();
bw.DoWork += (s, args) =>
{
Action action = delegate()
{
PerformScanning();
};
Dispatcher.Invoke(
DispatcherPriority.Background, action);
};
bw.RunWorkerCompleted += (s, args) =>
{
ScanBusyInd.IsBusy =
false;
};
bw.RunWorkerAsync();
}
But still busy indicator is not getting displayed. same thing works in other POC application.
I am not able to understand what am I missing here ?
Screen scenario :-
My screen is having so many WPF and third party scanning viewer related controls
After clicking on start scan button, lot of process is going on, like scanning various pages, savning them, creating some text files, assigning some values to control.
Could anybody suggest, what more needs to be done here?
Quick suggestions will be really helpful and appreciated.
Thanks
Sarang
<telerik:RadComboBox ItemsSource="{Binding MinorTickProviders}" SelectedItem="{Binding SchedulerViewSettings.MinorTickLength,Mode=TwoWay}"> <telerik:RadComboBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding ., Converter={StaticResource TickConverter}}" /> </DataTemplate> </telerik:RadComboBox.ItemTemplate> </telerik:RadComboBox>private List<ITickProvider> minorTickProviders;public List<ITickProvider> MinorTickProviders { get { return this.minorTickProviders; }}this.minorTickProviders = new List<ITickProvider>();this.minorTickProviders.Add(new FixedTickProvider(new DateTimeInterval(2, 0, 0, 0, 0)));this.minorTickProviders.Add(new FixedTickProvider(new DateTimeInterval(5, 0, 0, 0, 0)));this.minorTickProviders.Add(new FixedTickProvider(new DateTimeInterval(10, 0, 0, 0, 0)));this.minorTickProviders.Add(new FixedTickProvider(new DateTimeInterval(15, 0, 0, 0, 0)));this.minorTickProviders.Add(new FixedTickProvider(new DateTimeInterval(20, 0, 0, 0, 0)));this.minorTickProviders.Add(new FixedTickProvider(new DateTimeInterval(30, 0, 0, 0, 0)));this.minorTickProviders.Add(new FixedTickProvider(new DateTimeInterval(0, 1, 0, 0, 0)));this.minorTickProviders.Add(new FixedTickProvider(new DateTimeInterval(0, 2, 0, 0, 0)));this.minorTickProviders.Add(AutomaticTickLengthProvider.MinorProvider);public class TickConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { FixedTickProvider provider = value as FixedTickProvider; if (provider != null) { string interval = string.Format("{0:d2}:{1:d2}:00", provider.Interval.Hours, provider.Interval.Minutes); if (provider.Interval.Hours == 0 && provider.Interval.Minutes == 0) { if (provider.Interval.Days == 1) { interval = "1 day"; } else { interval = string.Format("{0} days", provider.Interval.Days); } } return interval; } return "Automatic conversion"; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } }private ITickProvider mMinorTickLenght; public ITickProvider MinorTickLength { get { return mMinorTickLenght; } set { mMinorTickLenght = value; } }MinorTickLength = new FixedTickProvider(new DateTimeInterval(20, 0, 0, 0, 0));Properties are not displayed in the propertygrid if the class implements ICustomTypeDescriptor. Why?
--
/// <summary> /// Interaction logic for Myobjects.xaml /// </summary> public partial class Myobjects : Page { public Myobjects() { InitializeComponent(); radPropertyGrid1.AutoGeneratingPropertyDefinition += new EventHandler<Telerik.Windows.Controls.Data.PropertyGrid.AutoGeneratingPropertyDefinitionEventArgs>(radPropertyGrid1_AutoGeneratingPropertyDefinition); radPropertyGrid1.Item = new Variable(); } void radPropertyGrid1_AutoGeneratingPropertyDefinition(object sender, Telerik.Windows.Controls.Data.PropertyGrid.AutoGeneratingPropertyDefinitionEventArgs e) { AttributeCollection attributes = TypeDescriptor.GetProperties(typeof(Variable))[e.PropertyDefinition.DisplayName].Attributes; BrowsableAttribute browsable = attributes[typeof(BrowsableAttribute)] as BrowsableAttribute; if (browsable != null) { e.Cancel = !browsable.Browsable; } //CategoryAttribute category = attributes[typeof(CategoryAttribute)] as CategoryAttribute; //if (category.Category == "Common") //{ // e.Cancel = false; //} } } public class Variable : ICustomTypeDescriptor, INotifyPropertyChanged { [Browsable(false)] [Category("Common")] public int Id { get; set; } [Category("Common")] public string Name { get; set; } [XmlAttribute("mandatoryCondition")] [Category("Required Field")] public string MandatoryCondition { get; set; } [XmlAttribute("mandatoryConditionMessage")] [Category("Required Field")] public string MandatoryConditionMessage { get; set; } /// <summary> /// Datatype of the Variable /// </summary> private DataType dataType = DataType.String; [XmlAttribute("dataType")] [Category("Common")] public DataType DataType { get { return this.dataType; } set { this.dataType = value; NotifyPropertyChanged("DataType"); } } #region ICustomTypeDescriptor Members public AttributeCollection GetAttributes() { return TypeDescriptor.GetAttributes(this, true); } public string GetClassName() { return TypeDescriptor.GetClassName(this, true); } public string GetComponentName() { return null; } public TypeConverter GetConverter() { return TypeDescriptor.GetConverter(this, true); } public EventDescriptor GetDefaultEvent() { return TypeDescriptor.GetDefaultEvent(this, true); } public PropertyDescriptor GetDefaultProperty() { return TypeDescriptor.GetDefaultProperty(this, true); } public object GetEditor(Type editorBaseType) { return null; } public EventDescriptorCollection GetEvents(Attribute[] attributes) { return TypeDescriptor.GetEvents(this, attributes, true); } public EventDescriptorCollection GetEvents() { return TypeDescriptor.GetEvents(this, true); } public object GetPropertyOwner(PropertyDescriptor pd) { return this; } public PropertyDescriptorCollection GetProperties(Attribute[] attributes) { return this.GetProperties(); } // Method implemented to expose mandatory field properties conditionally, depending on DataType property public PropertyDescriptorCollection GetProperties() { var props = new PropertyDescriptorCollection(null); foreach (PropertyDescriptor prop in TypeDescriptor.GetProperties(this, true)) { if (prop.Category == "Common" && this.DataType != DataType.String) continue; if (prop.Category == "Range" && (this.DataType != DataType.Integer && this.DataType != DataType.Float)) continue; if (prop.Category == "Required Field") continue; props.Add(prop); } return props; } #endregion #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged(String info) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(info)); } } #endregion } public enum DataType { String, Integer, Float, Boolean, Date }
<telerik:RadWindow x:Class="WPF.TestForm1" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Height="300" Width="300" Header="Hello"> <Grid> </Grid></telerik:RadWindow>Ã MS.Internal.VSUtilities.GetBuildAction(IVsHierarchy hierarchy, UInt32 itemid) Ã Microsoft.VisualStudio.ExpressionHost.HostServices.HostSourceItem.<>c__DisplayClass9.<Microsoft.Expression.DesignHost.IHostSourceItem.get_BuildItemType>b__7() Ã Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker() Ã Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.Invoke(Boolean waitingInExternalCall) Ã Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.InvokeCall(Call call) Ã Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.DirectInvoke(Action action, Int32 sourceApartmentId, Int32 targetApartmentId, Int32 originId, WaitHandle aborted) Ã Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.DirectInvokeInbound(Action action, Int32 targetApartmentId) Ã Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId) Ã Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action) Ã Microsoft.VisualStudio.ExpressionHost.HostServices.HostSourceItem.Microsoft.Expression.DesignHost.IHostSourceItem.get_BuildItemType() Ã Microsoft.Expression.DesignHost.HostSourceItemData..ctor(IHostSourceItem item) Ã Microsoft.VisualStudio.ExpressionHost.HostServices.HostProject.<Microsoft.Expression.DesignHost.IHostProject.get_InitializationData>d__7e.MoveNext() Ã Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteEnumerable`2.RemoteEnumerationThunk.<>c__DisplayClass8.<NextChunk>b__7() Ã Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass16`1.<MarshalIn>b__15() Ã Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()