how to make a button fixed at top of the page even if the page is scrolled in silver light? - silverlight-5.0

I want to have three button at top of the page which stay visible if the page scrolled,
(I've tried separating the other contents from buttons by scroll viewer but I don't want to have scroll viewer in my content).any one knows how to have sticky panel or how to make button fixed at the top of page regardless of page scrolling??
I've tried below but I don't want to have scroll viewer in my code.
<Grid x:Name="LayoutRoot" >
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
//My Buttons
</StackPanel>
<ScrollViewer Grid.Row="1">
//My Content
</ScrollViewer>

yeah you can easily get this effect by setting the property VerticalScrollBarVisibility to Hidden.
scroll bar don't appear on the page but you can scroll the page down.
<ScrollViewer VerticalScrollBarVisibility="Hidden">
//your content goes here
</ScrollViewer>

Related

hint in TextField doesn't display

I am working with Nativescript-Vue and have several text fields that I would like to put a little text in the background so the user knows what values (name, address, etc) should go in there. I don't have room for labels and I see that TextField has a hint...so my thinking is I should be able to use that? However, this doesn't render anything.
<StackLayout orientation="horizontal" width="*" class="box">
<TextField class="line-text" v-model="customer.firstName" hint="First Name" width="500px" marginBottom="2px" marginTop="2px"></TextField>
<TextField class="line-text" v-model="customer.lastName" hint="Last Name" width="500px" marginBottom="2px" marginTop="2px"></TextField>
</StackLayout>

Ionic 3 ion-input captures focus of the whole row in Android

This ionic page is just a form with some elements. In the Phone field, I have created a modal that opens when you click on an image:
<ion-grid>
<ion-row>
<ion-col>
<form #registerForm="ngForm" novalidate [formGroup]="form">
[...]
<ion-item>
<img item-left margin-left src={{flagPath}} (click)="presentCountryModal()">
<p item-left (click)="presentCountryModal()">+{{countryCode}}</p>
<ion-icon item-left name="arrow-dropdown" (click)="presentCountryModal()">
</ion-icon>
<ion-input
placeholder="Phone"
type="text"
[(ngModel)]="account.phone"
name="phone"
required
pattern=".{8,}"
#phone="ngModel"
></ion-input>
</ion-item>
It works perfectly on iOS and Windows on ionic-lab. But in Android the behavior is different: when I click on the image, the Phone ion-input gets the focus and the whole form moves up, making space for the keyboard and hiding the field under the header.
I'd like to:
1) Be able to make the image clickable.
2) Disable the automatic scrolling when an ion-input gets focused. I've tried keyboard.disableScroll(true) with no success.
Any ideas? Thanks!
UPDATE:
As explained here, adding .input-cover { position: static; } to the scss files stabilizes the form and makes the image click event responsive! So that solves the first question.
But I still have the problem that, when the keyboard opens, the whole page moves up and the top elements hide below the header (and you can't scroll them down).
1) You need to make a separated ion-item form the img. If you have an ion-input inside an ion-item, everything you put together will be "part" of that input.
2) The easiest way to do this without manipulating via ts is using a regular input, not the ion-input or using the ion-input inside a div instead of the ion-item. The second one i'm just guesing, since the behaviour of the scroll for showing the keyboard happens if you have an ion-input inside ion-item.
Hope this helps :)

How to make Scrollable List area in a specific div in body (Onsen-UI)

I am making phonegap application using Onsen-UI. In that,I made a signup page. Now whenever I am trying to scroll the screen, whole body of page is scrolling. I want a particular division in a body that should scroll only. I have app Logo above the signup page and Logo is in the body part. So that shouldn't be scrolled. Only List div should be scrolled.
You can try using the <ons-scroller> directive:
<ons-scroller style="height: 200px">
<p>I am scrollable</p>
</ons-scroller>
I made a simple example: http://codepen.io/argelius/pen/dPeKOB
This option works to me:
<ons-page>
Toolbar here
<div class="background"></div>
<div class="content">
Scrollable content here
</div>
Fixed content here
</ons-page>
from: https://onsen.io/v2/api/js/ons-page.html

Sitecore - Adding button to FormDialog

Is it possible to add a custom button to a Sitecore FormDialog other than OkButton and CancelButton e.g. instead of this
<FormDialog Icon="cool.png" Header="A really cool header" Text="Link or un-link items" OKButton="Link" CancelButton="Close">
but something more like this
<FormDialog Icon="cool.png" Header="A really cool header" Text="Link or un-link items" OKButton="Link" UnLinkButton="UnLink" CancelButton="Close">
I don't think it is possible to add another button by passing in an attribute on the FormDialog element without modifying original the FormDialog.xml
But there is a placeholder element defined in the DialogForm control (in /sitecore/shell/Controls/Dialogs)
<def:Placeholder name="Buttons"/>
In the xml for your custom application you add controls to this placeholder:
<control xmlns:def="Definition" xmlns="http://schemas.sitecore.net/Visual-Studio-Intellisense">
<MyCustomForm>
<FormDialog Icon="cool.png" Header="A really cool header" Text="Link or un-link items" OKButton="Close" CancelButton="false">
<CodeBeside Type="MyCustomCode.Dialogs.MyCustomForm, MyCustomCode"/>
<GridPanel Columns="2" CellPadding="4" Width="100%" Height="100%">
<!-- Panel code here -->
</GridPanel>
<Border def:placeholder="Buttons" runat="server" style="float:right;">
<Button Header="Link" runat="server" Type="button" Click="Link_Click" />
<Button Header="Unlink" runat="server" Type="button" Click="Unlink_Click" onclick="return confirm('Are you sure you want to unlink?');" />
</Border>
</FormDialog>
</MyCustomForm>
</control>
Note you want to pass in CancelButton="false" which hides the cancel button and set the OK button text to "Close". Handle your Link/Unlink button server actions in the code behind. I've styled the button group to float:right so they then site next to the Close button.

xaml: multiple selected items in datagrid, each datagrid has a combobox, selecteditem changes every combobox - should only change selected combobox

I have a datagrid like so:
<DataGrid ItemsSource="{Binding Path=MyItems, Mode=OneWay}"
SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
in each item of the datagrid I have a combobox with a list of items:
<ComboBox ItemsSource="{Binding SelectedItem.SubItems}"
SelectedItem="{Binding SelectedComboItem}"
IsSynchronizedWithCurrentItem="True"/>
unfortunately, whenever I change 1 combobox, all other comboboxes also change their selected item.
Help ! I've looking for a solution for an entire day now...
Here's a quick example from something in use here, I've chopped out everything apart from the combobox within a datagrid so hopefully you can see where you've gone wrong with your bindings/logic:
<sdk:DataGrid x:Name="MyDatagrid" AutoGenerateColumns="False" ItemsSource="{Binding MyItems}">
<sdk:DataGrid.Columns>
<sdk:DataGridTemplateColumn Width="Auto" Header="Combo column" IsReadOnly="False">
<sdk:DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding SubItems, Mode=OneWay}" SelectedItem="{Binding SelectedComboItem,Mode=TwoWay}" />
</DataTemplate>
</sdk:DataGridTemplateColumn.CellEditingTemplate>
</sdk:DataGridTemplateColumn>
</sdk:DataGrid.Columns>
</sdk:DataGrid>
Things to note:
MyItems is a ViewModel property
SubItems is a property of class of items within MyItems, not the ViewModel. If you want your combobox ItemSource to come from the viewmodel then you will need something like:
{Binding DataContext.AllComboItems, RelativeSource={RelativeSource AncestorType=sdk:DataGrid}, Mode=OneWay}
SelectedComboItem is also a property on the class of items within MyItems, not the ViewModel.