private void copyFiles_Click(object sender, RoutedEventArgs e)
{
BackgroundWorker worker = new BackgroundWorker();
//LRP
copyFiles();
worker.DoWork += (o, ea) =>
{
for (int i = 0; i < 100; i++)
{
System.Threading.Thread.Sleep(50);
}
};
worker.RunWorkerCompleted += (o, ea) =>
{
_busyIndicator.IsBusy = false;
};
_busyIndicator.IsBusy = true;
worker.RunWorkerAsync();
}
New Post: BusyIndicator Not Visible
Edited Feature: WPF ToggleSwitch [17420]
The code is even easily accessible from WP7 SDKs, and can basically be copied/pasted from [here](http://www.theleagueofpaul.com/wp7-toggle-switch-in-wpf)
Another example can be found [here](http://toggleswitch.codeplex.com/releases/view/74327)
Even though the code is easily available, it would be preferable to have it included in a library with my other commonly-used custom controls; i.e. Extended WPF Toolkit...
Comments: ** Comment from web user: BoucherS **
This new control "ToggleSwitch" will be included in the v2.3 Plus version of the tookit.
Edited Feature: Create a TokenizedTextBox [18746]
I would like the TokenizedTextBox to be re-introduce in the toolkit.
Vote for this feature if you want that control in the Toolkit.
Created Unassigned: The invocation of the constructor on type 'Xceed.Wpf.DataGrid.DataGridControl' that matches the specified binding constraints threw an exception. [20931]
Did any one run into this issue. I"m running .net framework 4 VS 2010. Could someone tell me what am i doing wrong?
Commented Unassigned: The invocation of the constructor on type 'Xceed.Wpf.DataGrid.DataGridControl' that matches the specified binding constraints threw an exception. [20931]
Did any one run into this issue. I"m running .net framework 4 VS 2010. Could someone tell me what am i doing wrong?
Comments: ** Comment from web user: justin0805 **
I found the soulution. I was using runtime version v2.0.50727. I removed that reference and added a new reference that had runtime version v4.0.30319 and it worked.
New Post: How to disable auto-validation in DateTimePicker.
I appreciate the time you've spent on this.
CT
Closed Unassigned: The invocation of the constructor on type 'Xceed.Wpf.DataGrid.DataGridControl' that matches the specified binding constraints threw an exception. [20931]
Did any one run into this issue. I"m running .net framework 4 VS 2010. Could someone tell me what am i doing wrong?
Comments: not a bug
New Post: BusyIndicator Not Visible
Using your code, if you put the "copyFiles()" method Inside the "DoWork", the copy of the files will be done in background while the BusyIndicator will be shown. Have you tried this ?
private void Button_Click( object sender, RoutedEventArgs e )
{
BackgroundWorker worker = new BackgroundWorker();
_busyIndicator.IsBusy = true;
worker.DoWork += ( o, ea ) =>
{
//LRP
this.CopyFiles();
};
worker.RunWorkerCompleted += ( o, ea ) =>
{
_busyIndicator.IsBusy = false;
};
worker.RunWorkerAsync();
}
private void CopyFiles()
{
System.Diagnostics.Debug.WriteLine("Start Copy");
for( int i = 0 ; i < int.MaxValue ; ++i )
{
int x = 0;
}
System.Diagnostics.Debug.WriteLine( "End Copy" );
}
New Post: BusyIndicator Not Visible
New Post: BusyIndicator Not Visible
Interacting with UI in the BackgroundWorker will not work :
"You must be careful not to manipulate any user-interface objects in your DoWork event handler. Instead, communicate to the user interface through the ProgressChanged and RunWorkerCompleted events."
From
"http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker(v=vs.110).aspx"
Maybe you can create a new thread :
private void Button_Click( object sender, RoutedEventArgs e )
{
_busyIndicator.IsBusy = true;
Thread t = new Thread( () => this.CopyFiles( _busyIndicator ) );
t.Start();
}
private void CopyFiles( BusyIndicator busyIndicator )
{
System.Diagnostics.Debug.WriteLine("Start Copy");
int half = int.MaxValue / 2;
for( int i = 0; i < int.MaxValue; ++i )
{
int x = 0;
if( i == half )
{
this.Dispatcher.Invoke((Action)(() =>
{
//Do UI Stuff
Xceed.Wpf.Toolkit.MessageBox.Show( "My Message Box" );
}));
}
}
System.Diagnostics.Debug.WriteLine( "End Copy" );
//Stop BusyIndicator on UI Thread
this.Dispatcher.Invoke( ( Action )( () =>
{
busyIndicator.IsBusy = false;
} ) );
}
New Post: Magnifier toggle on and off
<CheckBox x:Name="chkZoomOn" />
and in the Magnifier control
<wpfx:Magnifier Visibility="{Binding ElementName=chkZoomOn, Path=Value}"
Obviously this does not work. Can anyone see anything glaring wrong with my approach?
Your input would be greatly appreciated. Thank you in advance.
New Post: Magnifier toggle on and off
The magnifier cannot access other elements in the XAML. There are 2 options :
A) Use EventTriggers from Checkbox to set the Visibility of the Magnifier :
<StackPanel >
<CheckBox x:Name="chkZoomOn" IsChecked="False">
<CheckBox.Triggers>
<EventTrigger RoutedEvent="CheckBox.Checked">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="_magnifier"
Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="00:00:00">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="CheckBox.Unchecked">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="_magnifier"
Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="00:00:00">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</CheckBox.Triggers>
</CheckBox>
<TextBox Text=" fkjdsf kjfh hewr aksfjl pqwi fbjf nklsdwq uhfjaksfh kjsaf">
<xctk:MagnifierManager.Magnifier>
<xctk:Magnifier x:Name="_magnifier"
Background="White"
BorderBrush="Green"
BorderThickness="2"
Width="150"
Height="150"
Visibility="Collapsed" />
</xctk:MagnifierManager.Magnifier>
</TextBox>
</StackPanel>
B) Use the "Checked" and "Unchecked" callbacks on the Checkbox to set the Visibility of the Magnifier :<StackPanel >
<CheckBox x:Name="chkZoomOn"
IsChecked="False"
Checked="chkZoomOn_Checked"
Unchecked="chkZoomOn_Checked">
</CheckBox>
<TextBox Text=" fkjdsf kjfh hewr aksfjl pqwi fbjf nklsdwq uhfjaksfh kjsaf">
<xctk:MagnifierManager.Magnifier>
<xctk:Magnifier x:Name="_magnifier"
Background="White"
BorderBrush="Green"
BorderThickness="2"
Width="150"
Height="150"
Visibility="Collapsed" />
</xctk:MagnifierManager.Magnifier>
</TextBox>
</StackPanel>
private void chkZoomOn_Checked( object sender, RoutedEventArgs e )
{
CheckBox checkBox = sender as CheckBox;
if( checkBox != null )
{
_magnifier.Visibility = ( checkBox.IsChecked.Value ) ? Visibility.Visible : Visibility.Collapsed;
}
}
New Post: Magnifier toggle on and off
New Post: Calender Control: How to get all dates in view (not user selected, entire month + overflow days)
I want to have my users scroll (mouse wheel, flick on tablet, arrow up/down) a month
or a week at a time. I need to know what DAYS are visible on the control and
highlight/disable those days that are free/holiday/busy/command reserve, etc.
So I need onVisibilityEvent to know what day Start is visible and what day End is visible,
then apply properties to all the visible days.
I see how if the user selects a DateRange, no problem. How do I get the DateRange for
the entire visible calender from which a selection is made ? NO selection returns a nullable
null value, denoting nothing is selected.
I need just the opposite, what is available to be selected so I can populate the days of our lives.
I'm waxing melodramatic.
I'm poking at it but you guys can point me faster.
Sincerely,
dB
Created Unassigned: Wizard: Best way to skip page on Back [20952]
Is there a way to ignore a page when the user hits Back, or is there a way on the Page_Enter or Page_Leave to find out which direction the user is progressing?
Thanks.
Commented Unassigned: Wizard: Best way to skip page on Back [20952]
Is there a way to ignore a page when the user hits Back, or is there a way on the Page_Enter or Page_Leave to find out which direction the user is progressing?
Thanks.
Comments: ** Comment from web user: BoucherS **
Hi,
You can listen for the event "Previous" on the Wizard itself. Then set the CurrentPage to skip the validation page :
```
private void Wizard_Previous( object sender, Toolkit.Core.CancelRoutedEventArgs e )
{
Xceed.Wpf.Toolkit.Wizard wizard = sender as Xceed.Wpf.Toolkit.Wizard;
if( wizard != null )
{
if( wizard.CurrentPage == wizard.Items[ 3 ] )
{
wizard.CurrentPage = wizard.Items[ 2 ] as WizardPage;
}
}
}
```
Commented Unassigned: Wizard: Best way to skip page on Back [20952]
Is there a way to ignore a page when the user hits Back, or is there a way on the Page_Enter or Page_Leave to find out which direction the user is progressing?
Thanks.
Comments: ** Comment from web user: daggmano **
Thanks, that worked perfectly. BTW, I realize I should have posted this under Discussions rather than Issues. If the Issue Gods could close this, that would be great.
New Post: Template SplitButton
Does it have something to do with the outer "ControlChrome"? You mention only the two "partial" chromes in your solution, but there are three, one encapsulating the other two. Lacking a better idea i also replaced that one with a Border. Could that be the problem?
Here is my ControlTemplate for the "custom" SplitButton:
<ControlTemplate TargetType="{x:Type toolkit:SplitButton}">
<Grid x:Name="MainGrid" SnapsToDevicePixels="True">
<Border x:Name="ControlChrome" Background="{TemplateBinding Background}" CornerRadius="2.75">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button x:Name="PART_ActionButton" Margin="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}" >
<Button.Template>
<ControlTemplate TargetType="Button">
<ContentPresenter />
</ControlTemplate>
</Button.Template>
<Grid>
<Border x:Name="ActionButtonBorder"
BorderThickness="1,1,0,1"
CornerRadius="2.75, 0, 0, 2.75">
<ContentPresenter Name="ActionButtonContent" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="true" />
</Border>
</Grid>
</Button>
<ToggleButton x:Name="PART_ToggleButton"
Grid.Column="1"
IsTabStop="False"
IsChecked="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<ContentPresenter />
</ControlTemplate>
</ToggleButton.Template>
<Grid>
<Border x:Name="ToggleButtonBorder"
Padding="1,0,1,0"
CornerRadius="0, 2.75, 2.75, 0"
>
<Grid x:Name="arrowGlyph" IsHitTestVisible="False" Margin="4,3,4,3">
<Path x:Name="Arrow" Width="7" Height="4" Data="M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z" Fill="#FF000000" />
</Grid>
</Border>
</Grid>
</ToggleButton>
</Grid>
</Border>
<Popup x:Name="PART_Popup"
HorizontalOffset="1"
VerticalOffset="1"
AllowsTransparency="True"
StaysOpen="False"
Placement="Bottom"
Focusable="False"
IsOpen="{Binding IsChecked, ElementName=PART_ToggleButton}">
<!-- TODO: Create Popup Styles that can be reused on all popups in the toolkit-->
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource ColorPickerDarkBorderBrush}">
<ContentPresenter x:Name="PART_ContentPresenter" Content="{TemplateBinding DropDownContent}" />
</Border>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Fill" TargetName="Arrow" Value="#AFAFAF" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Closed Unassigned: Wizard: Best way to skip page on Back [20952]
Is there a way to ignore a page when the user hits Back, or is there a way on the Page_Enter or Page_Leave to find out which direction the user is progressing?
Thanks.
Comments: Not a bug
New Post: Template SplitButton
Ok, let's try something else.
Keep the ButtonChromes in the Template, but remove the "RenderMouseOver", "RenderPressed" and "RenderChecked" properties. You can then set the Background colors with the triggers :
<ControlTemplate TargetType="{x:Type xctk:SplitButton}">
<Grid x:Name="MainGrid"
SnapsToDevicePixels="True">
<chrome:ButtonChrome x:Name="ControlChrome"
Background="{TemplateBinding Background}"
RenderEnabled="{TemplateBinding IsEnabled}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button x:Name="PART_ActionButton"
Margin="0"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Padding="{TemplateBinding Padding}">
<Button.Template>
<ControlTemplate TargetType="Button">
<ContentPresenter />
</ControlTemplate>
</Button.Template>
<Grid>
<chrome:ButtonChrome x:Name="ActionButtonChrome"
Background="{TemplateBinding Background}"
Foreground="{TemplateBinding Foreground}"
BorderThickness="1,1,0,1"
BorderBrush="{TemplateBinding BorderBrush}"
RenderEnabled="{TemplateBinding IsEnabled}">
<ContentPresenter Name="ActionButtonContent"
Margin="{TemplateBinding Padding}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
RecognizesAccessKey="true" />
</chrome:ButtonChrome>
</Grid>
</Button>
<ToggleButton x:Name="PART_ToggleButton"
Grid.Column="1"
IsTabStop="False"
IsChecked="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
IsHitTestVisible="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolConverter}}">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<ContentPresenter />
</ControlTemplate>
</ToggleButton.Template>
<Grid>
<chrome:ButtonChrome x:Name="ToggleButtonChrome"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
Padding="1,0,1,0"
RenderEnabled="{TemplateBinding IsEnabled}">
<Grid x:Name="arrowGlyph"
IsHitTestVisible="False"
Margin="4,3,4,3">
<Path x:Name="Arrow"
Width="7"
Height="4"
Data="M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z"
Fill="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
</Grid>
</chrome:ButtonChrome>
</Grid>
</ToggleButton>
</Grid>
</chrome:ButtonChrome>
<Popup x:Name="PART_Popup"
HorizontalOffset="1"
VerticalOffset="1"
AllowsTransparency="True"
StaysOpen="False"
Placement="Bottom"
Focusable="False"
IsOpen="{Binding IsChecked, ElementName=PART_ToggleButton}">
<!-- TODO: Create Popup Styles that can be reused on all popups in the toolkit-->
<Border BorderThickness="1" Background="{StaticResource PopupBackgroundBrush}" BorderBrush="{StaticResource ColorPickerDarkBorderBrush}">
<ContentPresenter x:Name="PART_ContentPresenter" Content="{TemplateBinding DropDownContent}" />
</Border>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled"
Value="False">
<Setter Property="Fill"
TargetName="Arrow"
Value="#AFAFAF" />
</Trigger>
<Trigger SourceName="PART_ActionButton"
Property="IsMouseOver"
Value="True">
<Setter TargetName="ActionButtonChrome"
Property="Background"
Value="Green" />
</Trigger>
<Trigger SourceName="PART_ActionButton"
Property="IsPressed"
Value="True">
<Setter TargetName="ActionButtonChrome"
Property="Background"
Value="Blue" />
</Trigger>
<Trigger SourceName="PART_ToggleButton"
Property="IsMouseOver"
Value="True">
<Setter TargetName="ToggleButtonChrome"
Property="Background"
Value="Red" />
</Trigger>
<Trigger SourceName="PART_ToggleButton"
Property="IsPressed"
Value="True">
<Setter TargetName="ToggleButtonChrome"
Property="Background"
Value="Blue" />
<Setter TargetName="Arrow"
Property="Fill"
Value="Green" />
</Trigger>
<Trigger SourceName="PART_ToggleButton"
Property="IsChecked"
Value="True">
<Setter TargetName="ToggleButtonChrome"
Property="Background"
Value="Yellow" />
<Setter TargetName="Arrow"
Property="Fill"
Value="Green" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>