First remark: I am impressed with this library, which I found this week trying to implement a ToggleSwitch. After a while I found that Microsoft developed the ToggleSwitch for UWP programs and, basically, all promises to move this (and more) controls to non UWP programs after UWP failed, were not fullfilled. There's XAML Islands but this apparently only works on a soon obsolete .Net 3.x. There's a Windows UI Library but this seems to work only on .Net5 and not on the Framework. And here we have your controls which works on all of them, implemented in 30 minutes. Can't you learn Microsoft some programming?
I do have a question however about the FluidProgressBar. Once I start it right before uploading FTP files, I use this.FPB.Visibility = Visibility.Visible to do so, it stalls (and will start moving again once the FTP upload is finished, if I would not show there this.FPB.Visibility = Visibility.Hidden.)
I tried moving it to a Async task but it still won't do anything during my FTP uploads.
Is there anything I can do? I also wonder if there's more documentation than above or in Github? It took me a while to figure out how to stop and start this (in this order because once added it directly start moving) and I am not even sure if this is the right solution.
Glad to know that you are finding the WPFSpark library useful.
Whenever the visibility of the FluidProgressBar changes (from Hidden or Collapsed) to Visible, the animation starts. And whenever it changes to Hidden or Collapsed, it stops.
From your scenario, it appears that the UI thread is getting blocked during your FTP uploads. I can think of the following solutions to your issue
1. Set the Visibility to Visibility.Visible on a UI thread. You can ensure this by calling it within a Dispatcher.BeginInvoke call.
2. Ensure that your FTP upload code is not running on the UI thread. You can make it run on a background thread so that the UI thread is not blocked. Otherwise the animation will stall.
Thanks for your reply. Over the last few weeks I have optimized the visibility of actions. I was under the impression that, when using MvvM, I needn't worry about it but the fact is that showing UI changes won't work without Dispatcher.BeginInvoke call either and that directly assigning control values is even much faster than using fields & MvvM .
This eventually resulted in all progress info showing during the progress so I didn't need the FluidProgressBar anymore.
However, your comments might come in handy in the future. And your ToggleSwitches make it shine already!
Hello Sir, I am trying to use RDLC to create certificates and I am using your api for windows. But it seems that it doesn't have any visual support for RDLC cause when I right click my mouse on report area it shows menu to print Report but in actual it doesn't get displayed. As far my code is concern I am putting xaml code for report viewer. Kindly assist me in this case as it is really urgent. My code is
Right now it is not possible because I am animating the Background Color and Storyboards require colors which are frozen (to prevent cross thread issues). Due to this I cannot use DynamicResource to specify the color.
However, I am planning to modify the ToggleSwitch to include support for Accent Color. Give me some time... will upload the modified version soon.
ToggleSwitch is being rendered this way because you are setting the width and height to be less than the MinWidth and MinHeight of the ToggleSwitch. When you do that, the rendering goes awry.
Since you are using the predefined style, in that style the MinWidth is set to 50 and the MinHeight is set to 30. you need to set the MinWidth and MinHeight to values lower than the Width and Height, like this
I have this up and running now, very nice effect, thanks.
Is it possible that the drag only happens when the user has started to drag an item rather than immediately on left mouse down? This way we can select, interact with items and not have them popping out to be dragged if the user simply wants to interact with them.
I am quite new to WPF and have got WPFSpark Installed but I am having difficulty in understanding how the FluidWrapPanel works. Am I to create my own Drag/Drop events which somehow makes the FluidWrapPanel move items out the way when a drag occurs or is Drag/Drop built in by simply adding the behavior to a UserControl as you show:
Have a look at the WPFSpark source code in GitHub. There you will see the solution contains two projects - WPFSpark.NET46 and WPFSparkClient.NET46.
The WPFSparkClient.NET46 contains the demo code which shows how the various controls in the WPFSpark library have to be used.
In order to support drag and drop within the FluidWrapPanel, add the FluidDragBehavior to each of the children. Just have a look at how FluidItemControl class is implemented in the WPFSparkClient.NET46 project. You can add the behavior declaratively in XAML
Got it working great now. I had a NullReferenceException in WPFSpark before but that was because I forgot to remove the code-behind that added the behavior (basically was adding it in xaml AND code). Doh!. All working now though. Thanks
System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
PM> Install-Package WPFSpark
Attempting to gather dependencies information for package 'WPFSpark.18.104.22.168' with respect to project 'TestWPFSpark', targeting '.NETFramework,Version=v4.6'
Attempting to resolve dependencies for package 'WPFSpark.22.214.171.124' with DependencyBehavior 'Lowest'
Resolving actions to install package 'WPFSpark.126.96.36.199'
Resolved actions to install package 'WPFSpark.188.8.131.52'
Install failed. Rolling back...
Package 'WPFSpark.184.108.40.206 : ' does not exist in project 'TestWPFSpark'
Package 'WPFSpark.220.127.116.11 : ' does not exist in folder 'c:\users\me\documents\visual studio 2015\Projects\TestWPFSpark\packages'
Install-Package : Could not install package 'WPFSpark 18.104.22.168'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6', but the package does not contain any assembly references or content files that are compatible with that framework. For more
information, contact the package author.
+ Install-Package WPFSpark
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand