XAML Control padding overlapping other controls - windows-phone-7

I am doing a windows phone app that I have a 6 x 6 grid of checkboxes, They have to be sized specifically to line up with a background image. I can get the content size correct, but the entire size of the control is too big. I am using the default controltemplate, and I have tried to set the padding to alter the padding between the content and the outer margin of the control but it does not change.
<CheckBox x:Name="chkc1r1" Content="" HorizontalAlignment="Left" Margin="42,24,0,0"
VerticalAlignment="Top" Height="58" Width="42" Tap="chkc1r1_Tap"
BorderThickness="0" UseLayoutRounding="True" Padding="-10"/>
What am I missing here?
After doing some more digging, I found that the property that I looking for is the touch overhang property, has anyone ever altered this property? A very old post that says it can be done in the App.xaml, but did not say how. Anyone have any Ideas?

Anyone have any Ideas?
Specify your own control template for your checkboxes. In Blend, right-click on a checkbox, "Edit Template/Edit a copy", save. Then in visual studio edit the template, replacing "{StaticResource PhoneTouchTargetOverhang}" with e.g. "0".

Related

How can I duplicate the look of a comment area on the iOS setting page in a TableView?

I would like to add comments to my settings page. Something that looks like the comment area below "Ask to Join Networks" on the Settings > Wi-Fi page of the iOS Settings.
Can anyone suggest how I can do this and how I can make use of Dynamic Typing so that when the user changes the font size the comment area changes to match that in iOS settings?
Note that I am okay to use an iOS Renderer if needed. At this time I am just concerned with an iOS solution.
Thank you very much
On iOS 11, the background color of a setting page is #EAEAF1 and the text color within a non-control area is #59595F
So add a Label to a ViewCell but place it within another container so you can control the margin of the label otherwise your label text will be flush on the left side vs. vertically aligned to the setting controls.
Something like this will get your started:
<ViewCell>
<StackLayout
Orientation="Horizontal"
BackgroundColor="#EAEAF1">
<Label
Margin="15"
TextColor="#59595F"
HorizontalOptions="CenterAndExpand"
LineBreakMode="WordWrap"
Text="This is a multi-line custom ViewCell-based label, sdfsdfsdfsddf sdfsdf sdf sdf sdf sdf sd fsd fsd fsdf df" />
</StackLayout>
</ViewCell>

How to change the font size of title property of a hubtile

i am using the hubtile control from the Microsoft.Phone.Controls.Toolkit
the xaml code for it is
<toolkit:HubTile x:Name="hub" Margin="12,12,0,0"
Title="{Binding Title}"
Message="{Binding Message}"
Source="{Binding Image}"
GroupTag="BindingHubTile" Tap="HubTile_Tap_1">
</toolkit:HubTile>
how to change the font size of the title property so that the whole title fits in?
You can't do this.
One way is find HubTile class and change default font size.
Download "Auto Scaling TextBlock for Silverlight" class and include it in your project.
Modify the ControlTemplate of the HubTile control to use the AutoScalingTextBlock instead of just TextBlock for title.

WP7 AutoCompleteBox Popup position

The toolkit:AutoCompleteBox in WP7 "opens" the Popup with results above the textfield. I need this Popup to be below the TextBox.
Wasted hours on this. finally, i've written my own autoCompleteBox with a ListBox opening below.
Just out of curiosity, pleas tell me how it shold be with the "original" one
I faced the same issue and this is how I solved it, using Perspective Transforms and RenderTransform in the borders of Popup in the default template.
<Popup>
<Grid>
<Border>
<Border.Projection>
<PlaneProjection GlobalOffsetX="-10" GlobalOffsetY="37" CenterOfRotationY="1" CenterOfRotationX="0" RotationX="180"/>
</Border.Projection>
<Border>
<Border.Projection>
<PlaneProjection RotationX="-180"/>
</Border.Projection>
<ListBox/>
</Border>
</Border>
</Grid>
</Popup>
Change GolbalOffsetX and GlobalOffsetY according to your textbox height and width.
There is no default property that will define the location for the popup in the AutoCompleteBox control.

WP7 PanoramaItem with Icon/Button next to Header

Windows Phone 7's People hub has an "all" panorama item with "search" and a "new" buttons right next to the header/title.
I can't seem to accomplish this with PanoramaItem in Visual Studio using the standard Panorama control. I don't know enough Silverlight/WPF either to be able to position something manually and control transitions/movement correctly.
How can I set a button (or any object, for that matter) to go alongside the header of a wp7 PanoramaItem?
Thanks!
A PanoramaItem Header doesn't have to be a string. It could be another StackPanel that has a CheckBox in it if you wanted, something like this:
<controls:PanoramaItem>
<controls:PanoramaItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock>Item</TextBlock>
<CheckBox>CheckBox</CheckBox>
</StackPanel>
</controls:PanoramaItem.Header>
<Grid>
<TextBlock>Your Content</TextBlock>
</Grid>
</controls:PanoramaItem>
So you can basically put anything in there that you want. Images, buttons, checkboxes, etc.

Is It Possible to Use TemplateBinding in a Storyboard in Silverlight?

I'm building a custom control in Silverlight and I want one of the fields to animate to the value of a DependencyProperty when that property is changed. More specifically, I have particular item in my Control Template that I want to animate to the color of the Background whenever the background changes color. So, what I have is:
<ControlTemplate TargetType="local:MyType">
<Grid x:Name="PART_RootElement">
<Grid.Resources>
<Storyboard x:Name="PART_FillAnimation">
<ColorAnimationUsingKeyFrames
BeginTime="00:00:00"
Storyboard.TargetName="PART_MainPath"
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
<EasingColorKeyFrame
x:Name="PATH_FillKeyframe"
KeyTime="00:00:01"
Value="{TemplateBinding Background}"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</Grid.Resources>
<!-- the rest of the template -->
I'm triggering the animation in the custom control code, but when the animation starts, it doesn't look like the Value is updating. I was just wondering if I'm missing something or if it is at all possible to apply TemplateBinding to resources in my ControlTemplate.
(I'm currently using a work-around of manually assigning the Background to the EasingColorKeyFrame Value, but the TemplateBinding solution would be so much cleaner.)
Have a look at Expression Blend Samples as a possible solution to your problem. There are a number of Interactivity classes that you could use within your ControlTemplate to create the effect your looking for. The documentation is not great, but descriptions in the Object Browser should give you some more clues :)
For example, I have a ListBox ItemTemplate that contains a ControlStoryboardAction Behaviour. The trigger for this Behaviour is a DataTrigger which fires when a DataContext field contains a specific value. (In my case when Severity=="High") The trigger then Plays a Storyboard within the ItemTemplate.
<i:Interaction.Triggers>
<is:DataTrigger Binding="{Binding Severity, Mode=OneWay}" Value="High">
<im:ControlStoryboardAction Storyboard="{StaticResource flashLight}" IsEnabled="True" />
</is:DataTrigger>
The following namespaces are referenced:
<i: - System.Windows.Interactivity
<is: - Expression.Samples.Interactivity (available from the link above. I am using the July 2009 release for SL3)
<im: - Microsoft.Expression.Interactivity.Media

Resources