UWP FormsComboBox and FormsTextBox Styling within Xamarin Forms - c#

I am using Xamarin Forms to create a POC app that runs on UWP, and the UWP XAML styling has me at a loss.
Could anyone please advise how to apply a similar style to the Picker (FormsComboBox in UWP) and Editor (which now that I look at it, may be the same as FormsTextBox which is what is used for the Entry, so that may be an easy one) as is done here for the Entry in UWP XAML and a CustomRenderer.
Among other things, it gets rid of the left, top, and right border and weird default UWP background and just leaves a bottom border (to be colored as per the introduced LineColor property set on the control).
Any guidance would be much appreciated.

Could anyone please advise how to apply a similar style to the Picker
Please check this in Xamarin source code. And it has declare FormsComboBox style in the PickerStyle.xaml file, please copy it to your App.xaml(uwp client project) and edit base on your requirement. And please note FormsComboBox removed EditableText that use to input the matched text in native combobox control.

Related

WindowsPhone 8.1 - Application Bar position

I'm forced to change look of ApplicationBar on application that runs on WindowsPhone 8.1. I need application bar to be on top not bottom. I tried to google it, but didn't come up with any simple solution. I'm not very experienced on this platform, so I would appreciate any help. Thanks.
I am not aware of any way to do this with the standard application bar
But you can do your own control - put a simple Grid with several AppBarButton controls at the top of your page. If you want more advanced functionality like handling orientation changes, menu items, etc. .. you will have to program them yourself.

CefSharp WebBrowser Example in WPF (transparency)

I'm working with WPF and c# (using Visual Studio 2013) and I want to develop an application with a transparent background and a webbrowser. I understand that this is an issue of the default webbrowser... but I want to find another solution. I found other webbrowser components like CefSharp that is based on chromium. I'd like to know if is possible using a transparent background using the CefSharp browser and I'd like that someone explain me step by step how to implement a very simple webbrowser (I found some article but I was not able to implement a working application). If you think that there are other better components please suggest me and explain me how to make them working.
Thank you for your attention and for the replies.
This is just a quick proof of concept hack based on CefSharp.Wpf.Example to see if it was doable. Depending on what you want I think it is possible to make (some) web pages transparent.
On the picture below you see CefSharp.Wpf.Example on top of Visual Studio. There's also a partial DevTools window from CefSharp in front in the lower left corner.
Here is what I did (refer to the picture below):
Add WindowState="Normal" Opacity=".75" AllowsTransparency="True" WindowStyle="None" MinHeight="400" MinWidth="600" to the <Window> element of MainWindow.Xaml
Add a call somewhere when the browser is initialized to its ShowDevTools() method.
I then used DevTools to set the <body>s background alpha to zero on the page loaded.
Depending on what you need you will have to experiment with WPF Opacity values yourself. Also depending on the web page you need to display removing the actual background color on different elements may need some tweaking. As you can see from the example above it just needed setting one value to remove the white background on the Google search page. You can use the ExecuteJavascriptAsync() method mentioned in the CefSharp FAQ wiki page to inject JavaScript in pages you navigate to.

Cant find "StyleApplication" toolbar in VS 2010?

As Joe Stagnner in his asp.net tutorial has used Style Application and target rule for creatng css code. I can't find any toolbar named StyleApplication.
Can anyone pls help me to locate this toolbar which gives me both option of style application and target rule? Tried experimenting with toolbars still not able to find.
It's merged with Formatting toolbar. There is Target rule drop down, Reuse existing style and Show overlay buttons in Formatting toolbar.

How to accomplish different states of view in WPF Apps

I have an idea for a personal project. And I know one way of accomplishing it in Windows Forms (which I no longer wish to use). Basically I could (in WinForms) just draw everything onto the screen (Form) and then when I need to switch views/states of the application, just redraw the new stuff in the old stuff's place.
But how can we have different states in WPF? Is there a "right" or "proper" way of doing this? Is something like this covered somewhere in the docs?
I'd like to do my own searching, but I have no idea what exactly to look for, and current attempts at finding the right information, so far have yielded no helpful (or even relevant) results.
Any help at all will be greatly appreciated. I am new to WPF, but have been making a lot of progress this past week!
Thank you!
P.S.:
I just thouhght of something. If the solution was to draw what is needed for one screen, and when it is time to display the next screen, just dispose of/hide everything and create/display the new stuff, then how would we get around this? Because we can't/shouldn't change XAML markup at runtime, can/should we? :/
Not sure how you drawn your views/states in WinForms (direct painting on a Graphics object?).
The closest to what you're describing is the VisualStateManager. You can use it to statically define several visual states inside a single XAML and transit between them (using a smooth animation if you want).
If what you've done was show different Forms with Show/ShowDialog(), then the equivalent would be to use different Windows and Show/Hide them.
If you just cleared/added Controls to your form, then you can do just the same in WPF. Most Controls in WPF have a Content or Children property instead of Control.Controls in Forms.
I don't know if I understand what you really want. But here are my thoughts:
You can use several Windows and Show/Hide them accordingly
You can use the Frame/Page functionality in WP (MSDN)
if you really need to you could load your XAML and remove the topmost content in your Window and replace it with the loaded content
You could use the VisualStateGroup functionality to change the appearance of your current window
I think you will be happy with the second solution

Make WPF Listview adhere to the Windows theme

I am an experienced coder who is trying to learn C# and WPF. Now, I am a bit of a stickler for detail, and I want to make sure my applications blend in with the rest of the user interface. However, I cannot seem to get this done using a ListView. My setup is simple - add a ListView to my window, bind to an ObservableCollection of my choice, and run the application.
The result is that the items pop up just fine (be it without meaningful contents). However, the selection rectangle on a ListView is always the dark blue that throws me back to the pre-XP days as opposed to the neater themed selection you have using the default Windows 7 visual style. To see that kind of selection in action, just select a file in explorer, or for another example look in the Programs and Features in the Control Panel. That looks nice and slick.
How can I get WPF to properly theme my ListView depending on my user settings? I don't want to reinvent the entire selection code and add tons of styling and doodahs like that - I want a plain Windows application that looks okay. The button works fine, textboxes work fine, comboboxes look fine, etc. It's just the ListView that looks totally crap.
Edit: I have no problems using another (very, very preferably not a thirdparty) control if required, but I do want a list of items that looks native and I approach a layout similar to the Tiles option in Explorer for each selected item (icon, desc, extra line of info). Vertical scrolling only is what I need.
If you use a ListView with ListView.View set to a GridView then you get a pretty similar look as Windows 7 explorer. (Atleast in my opinion, or is this the look you're talking about?). It also follows the active theme
Example 1. ListView with GridView to the right. Selection active
Example 2. ListView with GridView to the right. Selection inactive
Example 3. Using High Contrast Theme #2

Categories

Resources