Detecting and Implementing Scrollbar Style in Window 8/RT Application - windows

I am developing a Custom Control to be placed inside a ScrollViewer, I have Custom coded a generic.xaml for applying visual style for the Scrollviewer.
<ScrollBar x:Name="VerticalScrollBar"
Grid.Row="0"
Grid.Column="1"
Width="18"
Margin="0,-1,-1,-1"
IndicatorMode="TouchIndicator"
IsTabStop="False"
Maximum="{TemplateBinding ScrollableHeight}"
The Problem I am facing is, I need to set the IndicatorMode to TouchIndicator/MouseIndicator based on whether the user is using Touch Devices or not.
Is there a way to do it?
Thanks
Arun Selva Kumar. B

Used Visual State Manager to achieve the requirement.

Related

Background at passowordBox in the uwp

I am using the uwp component password box (XAMARIN) and set a certain image as the background, but when I click on the box, the background changes. I would like to keep the background static.
<PasswordBox x:Name="PasswordUser">
<PasswordBox.Background >
<ImageBrush ImageSource="/Assets/Login/campo-senha.png"/>
</PasswordBox.Background>
</PasswordBox>
PasswordBox.Background before clicked
PasswordBox.Background after clicked
So I would like the background to remain as I set it, always even when I click click on the box.
Please check PasswordBox style xaml, the password background has point over and focused status. so you need re-write the following resource with the ImageBrush that contains the same image source. You could place the follow resource in the page resource or application resource base on your design.
<ImageBrush x:Key="TextControlBackgroundPointerOver" ImageSource="/Assets/bgimg.png" />
<ImageBrush x:Key="TextControlBackgroundFocused" ImageSource="/Assets/bgimg.png" />

To create SlidingupPanel like googleMaps for both android and IOS

Do you know how to create a SlideUpPanel like GoogleMaps for both Android and iOS using Xamarin?
If I use SliddingupPanel layout is only for android
Help me, please.
I would suggest you use DKSlideUpPanel
It's easy to use and fast
Steps:
First, simply reference the NuGet package in your Xamrin.Forms projects.
Second, initialize SlidingUpPanel instance either in XAML or C#.
Lastly, apply the SlidingPanelConfig for your customizations.
How to use:
Add a mainView something like this;
<DK:SlidingUpPanel x:Name="spTest">
<DK:SlidingUpPanel.MainView>
<StackLayout Orientation="Horizontal" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
**MainDesign**
</StackLayout>
</DK:SlidingUpPanel.MainView>
Set panel ratio and if you want the toolbar visible:
<DK:SlidingUpPanel.PanelRatio>0.4</DK:SlidingUpPanel.PanelRatio>
<DK:SlidingUpPanel.HideNavBar>True</DK:SlidingUpPanel.HideNavBar>
Check the following guide for an even better understanding of how it works:
https://www.c-sharpcorner.com/article/xamarin-forms-slideuppanel-app/

Can I pass Android styles in parameters with Xamarin.Forms XAML

Is there a way (without using a renderer) that I can set styling for Android switches in a way like this:
<Switch android:colorControlActivated="#FF00FF"
HorizontalOptions="End" VerticalOptions="Center"
IsToggled="{Binding PbSwitch}" />
No. It is shared logic, you can't use platform spec staff there without abstraction. Why does renderer not suit you?

Is it possible to use Image Set in a Xamarin Forms

I am trying to add some Images as Image Sets in a Xamarin.Forms project. I followed this guide . But the icon is not displayed. Is it possible actually to use Image Sets in a Xamarin Forms Solution for the iOS project?
<Image VerticalOptions="Center"
HorizontalOptions="End"
Source="check_outline_500_active.png"
WidthRequest="40">
</Image>
Yes you can.
create the Asset catalog
add Image Set and name it "check_outline_500_active" (without .png)
add the images
done
my xaml
<Image VerticalOptions="Center"
HorizontalOptions="Center"
Source="check_outline_500_active.png">
</Image>
Result
Note
You might have to delete mtbs (on the mac) and bin/obj (on your project) or the build cache can fool you :)
Try to add images in resources folder under xamarin ios project and rename file like :
check_outline_500_active.png,
check_outline_500_active#2x.png,
check_outline_500_active#3x.png
but in code use : check_outline_500_active.png

Use StaticResources in Class Library on Windows 8.1

I want to create a class library for my Windows 8.1 project, which includes all the views for my app. So I've created the project, but Visual Studio told me that it is not possible to access the StaticResources.
<StackPanel>
<TextBlock
Text="123"
Style="{StaticResource HeaderTextBlockStyle}" />
<TextBlock"
Text="456"
Style="{StaticResource HeaderTextBlockStyle}" />
</StackPanel>
For example 'HeaderTextBlockStyle' was marked in blue and it told me that the resource 'HeaderTextBlockStyle' could not be found. So I can't see my page in the designer, because of the issue.
I can run my app without problems, but how can I get access to the StaticResources?
In Windows 8.1 some things have changed, including the inclusion of the StandarStyles.xaml (it's no longer included explicitly). This guide is very helpful to make the transition: http://blogs.windows.com/windows/b/appbuilder/archive/2013/07/24/windows-8-to-windows-8-1-preview-starting-with-the-xaml-templates.aspx
For your specific problem I recommend you to try:
Style="{ThemeResource HeaderTextBlockStyle}"

Resources