C# WP8 Open TimePicker from code - c#

How can I open the TimePicker to select new time but from C#? Not by tapping the control.
Is there any simple way to do that?

I had the same problem once. I solved it by forking the Windows Phone Toolkit and making the OpenPickerPage of the control public.

(I assume you mean the Windows Phone Toolkit TimePicker control here.)
From reading the source code of the DateTimePickerBase, it would seem not. Opening the picker page is done by the OpenPickerPage() method, which is private, and is only called from the OnDateButtonClick method, which is also private and handles the Click event on a private Button.
Of course, as the control is open-source, you can take the source code of the control and make your own copy of it with one of these methods exposed. As far as I can tell, it's allowed under the Ms-PL.

Related

How to implement Pointer-/MouseMoveEvents in Xamarin UWP app?

I have a Xamarin app. (Only) for the UWP app I need access to the mouse events (PointerMoved- / PointerEntered / PointerPressed-Events).
Until now my entire codebase is shared code.
Can somebody help me with forwarding the mouse events to the shared Code base? I googled a lot and nearly all answers either suggest a paid libary called "MR.Gestures" or say that it is not possible to recieve mouse Events (like this one I am not able to implement MouseUp, MouseDown and mouseMove Events in Xamarin Mobile applications). Sometimes GestureRecogniser are mentioned, but they Arent extensible, so how are they supposed to help?
Is there really no way to recieve mouse Events in xamarin?
You can do this. However it is a very extensive work to the level that you might consider to write your app in the native UWP XAML and share some C# code with the Xamarin project instead.
The way would be to extend each control that you are going to use (yes every single control that needs this effect), add to it those events and then write the UWP custom renderers that would invoke those events and then replace all controls in your XAML with those controls.
As said this may turn to be quite extensive work, but that's how it can be done.
Also if you don't need those events but just some visual effects on those events it may be possible to cut on this work by writing a custom XAML styles for those controls in app.xaml in the UWP project.

How use AddressChanged event in CefSharp WPF?

I try to develop WebBrowser on c#, wpf and CefSharp for experience.
Use tabcontrol for tabs and TextBox for URL textbox.
I want, when address of page is changed, textboxurl was updated too.
So in CefSharp for WinForms i find AddressChanged event.
Like in this video https://www.youtube.com/watch?v=itpEj1yB_Tg
But when i want use it with CefSharp WPF i cant use it.
So maybe i can add it by myself?
I find ChromiumWebBrowser.OnAddressChanged Method in APIDoc.
http://cefsharp.github.io/api/51.0.0/html/M_CefSharp_Wpf_ChromiumWebBrowser_OnAddressChanged.htm
How can i use it?

Native UI using WPF

I'm switching from Windows Forms to WPF, but WPF's GUI is really ugly. It looks like Windows 95 or something like that.
Example:
Left is a new WPF project
Right is a new Windows Forms project
Both only have a button and textbox added to the project, no other changes.
As you can see, WPF doesn't have the "native Windows GUI". I know that I can use themes, but I just want the native Windows GUI. Isn't there any setting to do this without themes? I've found this but I didn't change anything in the project except for the button and the textbox and it still doesn't look native.
See this workaround. there's some button styles there to make the buttons look more similar to the native ones. Other than that, see here the official statement from Microsoft that this difference is actually by design. They made intentional changes to the themes to make them more lightweight by removing gradients and such.

How to create a custom button for Windows Store app?

I want to make a custom button in shape of a picture with C# for a Windows Store App?
Is there a way to do that from xaml? So far I've made a button and assigned a circle as a background image, but the problem is that even if I click outside the image the button works.
Also I do not believe that Image class has an event for click unfortunately.
I just recently implemented the WinRT XAML toolkit and it works wonder for me. It has an imagebutton control that might do what you want to do. http://winrtxamltoolkit.codeplex.com/
With the help of google: Walkthrough: Create a Button by Using XAML
You should have a look into Expression Blend. You can do all manualy in the XAML-Code but Blend is a huge help if you like to customize your project look and feel. Look at the MSDN-Examples.

Creating a round button

In my wp7 app, I use C# to create user interface. I want to create a round button in C# not in xaml. is it possible to do that only in C# (not with the help of xaml) ? if yes, how to do this? and also please explain how to change a style of a button or any other control by using C# code?
Yes you can but don't know why you'd want to. Much easier to do with styles. Even easier to use one from an existing toolkit.
There is a round button in the Coding4Fun Phone Toolkit.
Get it via NuGet or download it here

Categories