Disable the swap in WP8 - windows-phone-8

I'm developing windows phone 8 application.
How I can disable the swap between the items in the pivot page ? since I disabled the IsHitTestVisible property to do that.
But When I used it ; controls in the item page doesn't accept input from user?
How I can disable the swap ? and allow the input from the user in the same time ?

In order to stop the Pivot on WP8 for switching PivotItems, use the new Pivot.IsLocked=true property. Read more about it here # http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.controls.pivot.islocked(v=vs.105).aspx
For example, this code snippet shows how to use Pivot.IsLocked on WP8:
<phone:Pivot IsLocked="True">
<phone:PivotItem Header="Foo">
<TextBox />
</phone:PivotItem>
<phone:PivotItem Content="Bar" Header="Bar" />
<phone:PivotItem Content="Baz" Header="Baz" />
</phone:Pivot>
When you run this code snippet you can see the Pivot only shows the first PivotItem but you can still interact with it (which isn't possible if you simply set IsEnabled=False).
For WP7, use there's a LockablePivot in the Windows Phone toolkit that support this same property. Read more about it here # http://www.windowsphonegeek.com/articles/Windows-Phone-Toolkit-LockablePivot-in-depth

Related

UWP ListView in touch mode

I have this ListView in a Windows 10 project:
<ListView ItemsSource="{x:Bind ViewModel.ItemsList, Mode=TwoWay, Converter={StaticResource BindableSourceConverter}}"
ScrollViewer.HorizontalScrollMode="Disabled"
ScrollViewer.VerticalScrollMode="Disabled"
RelativePanel.Below="pageHeader"
CanReorderItems="True"
SelectionMode="None"
CanDragItems="True"
AllowDrop="True"
CanDrag="True" />
and i need to allow the user to reorder the ListView.
Using mouse everything works fine, but using the touch, i need to wait one second before that i'm able to move the items around.
Any idea on how to fix that?
There isn't any, if you don't wait one second internal ScrollViewer thinks you do scroll action. Since it can't know your intention for sure, it can't know the difference.
If you don't need scroll action, consider not using ListView.

Windows Phone 8.1, binding to AppBarButton not rendering

I'm displaying a string of several characters in an AppBarButton in a Windows Phone application. The string consists of the Segoe UI Symbol character "attach" (\uE16C) and a the number of items the user has already attached.
I've binded the AppBarButton's Icon property to a the number of items that have been attached, which is converted to a FontIcon.
<AppBarButton Icon="{Binding ItemCount, Converter={StaticResource IntToFontIconConverter}}"/>
However, for some reason the AppBarButton doesn't seem to always re-render when the FontIcon changes. I've vertified that the binding is updated and the AppBarButtons FontIcon changes, but it's not reflected on the phone's screen.
Is there someway to force the button to re-render when the FontIcon changes?
Check below code it might solve your problem
<AppBarButton Label="BitmapIcon" Click="AppBarButton_Click">
<AppBarButton.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/globe.png"/>
</AppBarButton.Icon>
find more details on https://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj662743.aspx

Using a resw file in a Universal App

I'm following the instructions at http://msdn.microsoft.com/en-gb/library/windows/apps/xaml/hh965326.aspx on how to add a resources file, but I must be doing something wrong because it doesn't work.
I created a new Universal app, checking that the Default language is set to en-US in both Package.appxmanifest files.
I created a Resources.resw file, in Strings/en-US. This file has three values:
Greeting.Text = Hello
Greeting.Width = 20
Farewell = Goodbye
Then, in MainPage.xaml, I've got the following:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="Greeting" Text="" />
</StackPanel>
</Grid>
When I run the app, nothing appears - the text box has no content. The instructions in the MS quickstart don't say it, but does some sort of additional association have to be done, such as referencing the Resources.resw file in the App.xaml?
I assume you meant TextBlock (not TextBox) has no content when you run the app.
A couple of things to check:
Does it help if you delete Greeting.Width or set it to a larger value (maybe TextBlock) is to narrow to show anything)?
Could the text be hidden behind the performance counters in the top left corner of the app? Try adding Margin="100" to your TextBlock just to be sure.
Do you have BuildAction for Resources.resw set to PRIResource?
You don't have any other code which could affect the content of your TextBlock?
If this doesn't help, can you put your sample somewhere for download? This would make it easier to troubleshoot.

Strange behavior horizontal scrollview of app when create with VS 2012

I'm learning Windows Store App development, I create a simple project with "Grid App" in Visual 2012, after that I run app and see that the Horizontal Scrollbar behavior very strange, see the screenshot:
Anyone see this problem? I try to create the Grid App in VS 2013 and it's work correct, I think it's a bug of VS 2012 right?
Thank you!
This is not bug in Vs 2012..this is occur because of virtualization i.e
listbox or listview not loaded all content when it is loaded first time but when u start to scroll it start to load content ..so as no of content loaded thumb start to become small in size..thats why initially thumb appear as big and later small when scroll.for example you can visit facebook(vertical scrollviewer).
refer this link for understanding http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.listview.aspx
In winrt default gridview style ItemsPanel like this ..visit style of gridview (C:\Program Files (x86)\Windows Kits\8.0\Include\WinRT\Xaml\Design)
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WrapGrid Orientation="Vertical" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
and ItemsPanelTemplate wrapgrid is inheriated from VirtualizingPanel http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.wrapgrid
VirtualizingPanel is used for virtualiztion purpose and as you said it is not in vs 2013 means they haven't used VirtualizingPanel for itemspanel..
Visit this links
http://msdn.microsoft.com/en-us/library/windows/apps/hh780657.aspx
http://msdn.microsoft.com/en-us/library/windows/apps/hh994637.aspx
thank you

How to use Command for SelectionChanged of Pivot control

I am using latest version MVVMLight to develop a WP application. I am aware of how to use Command instead of writing code in button click event.
<Button Content='Push me' Command='{Binding DisplayMessageCommand}' />
However, How do i use the Command for SelectionChanged of Pivot control ?
I don't want to write code in SelectionChanged event in code behind .cs file of xaml page.
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding SampleCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>