AvalonDock dock panels - avalondock

I have created the dockable panel using avalondock but by default the panel is coming on right side. How to move the panel to left side?
<avalonDock:DockingManager x:Name="dockingManager" cal:RegionManager.RegionName="MainRegion">
<avalonDock:LayoutRoot >
<avalonDock:LayoutPanel Orientation="Horizontal">
<avalonDock:LayoutDocumentPane/>
<avalonDock:LayoutAnchorablePane DockWidth="150" >
<avalonDock:LayoutAnchorable local:AvalonDockRegion.Name="SampleToolRegion"/>
</avalonDock:LayoutAnchorablePane>
<avalonDock:LayoutAnchorablePane DockWidth="150" >
<avalonDock:LayoutAnchorable local:AvalonDockRegion.Name="SampleRibbonRegion" />
</avalonDock:LayoutAnchorablePane>
</avalonDock:LayoutPanel>
</avalonDock:LayoutRoot>
</avalonDock:DockingManager>
</Grid>

Not sure i understand your question.
if the 2 panes are sorted from right to left Try to set the flow direction of the docking manager to left to right
<avalonDock:DockingManager x:Name="dockingManager" cal:RegionManager.RegionName="MainRegion" FlowDirection="LeftToRight">
<avalonDock:LayoutRoot >
<avalonDock:LayoutPanel Orientation="Horizontal">
<avalonDock:LayoutDocumentPane/>
<avalonDock:LayoutAnchorablePane DockWidth="150" >
<avalonDock:LayoutAnchorable local:AvalonDockRegion.Name="SampleToolRegion"/>
</avalonDock:LayoutAnchorablePane>
<avalonDock:LayoutAnchorablePane DockWidth="150" >
<avalonDock:LayoutAnchorable local:AvalonDockRegion.Name="SampleRibbonRegion" />
</avalonDock:LayoutAnchorablePane>
</avalonDock:LayoutPanel>
</avalonDock:LayoutRoot>
</avalonDock:DockingManager>

<avalonDock:DockingManager x:Name="dockingManager" cal:RegionManager.RegionName="MainRegion">
<avalonDock:LayoutRoot >
<avalonDock:LayoutPanel Orientation="Horizontal">
<avalonDock:LayoutAnchorablePane DockWidth="150" >
<avalonDock:LayoutAnchorable local:AvalonDockRegion.Name="SampleToolRegion"/>
</avalonDock:LayoutAnchorablePane>
<avalonDock:LayoutAnchorablePane DockWidth="150" >
<avalonDock:LayoutAnchorable local:AvalonDockRegion.Name="SampleRibbonRegion" />
</avalonDock:LayoutAnchorablePane>
<avalonDock:LayoutDocumentPane/>
</avalonDock:LayoutPanel>
</avalonDock:LayoutRoot>
</avalonDock:DockingManager>
Just changed the sequence of LayoutDocumentPane and LayoutAnchorablePane.
Hope I have understood your question correctly.

Related

AvalonDock LayoutPanel not displaying in Visual Studio Design mode

I am using Dirkster99's AvalonDock (version 4.60.1) and the docking layout disappears in Design mode:
When running the application, it shows up fine:
XAML:
<Window x:Class="DockingTestWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:avalonDock="clr-namespace:AvalonDock;assembly=AvalonDock"
xmlns:avalonDockLayout="clr-namespace:AvalonDock.Layout;assembly=AvalonDock"
mc:Ignorable="d">
<Grid x:Name="MainGrid">
<!--#region Docking Manager -->
<avalonDock:DockingManager x:Name="dockingManager"
AllowMixedOrientation="True">
<avalonDockLayout:LayoutRoot x:Name="layoutRoot">
<avalonDockLayout:LayoutPanel x:Name="mainLayoutPanel"
Orientation="Horizontal">
<!--#region Main Left Column -->
<avalonDockLayout:LayoutPanel x:Name="leftPanel"
Orientation="Vertical"
DockWidth="4*">
<avalonDockLayout:LayoutPanel Orientation="Horizontal"
x:Name="left1"
DockHeight="3*">
<avalonDockLayout:LayoutAnchorablePane DockWidth="4*"
Name="left11">
<avalonDockLayout:LayoutAnchorable Title="A"
ContentId="A"
x:Name="A">
<Border Background="Red" />
</avalonDockLayout:LayoutAnchorable>
</avalonDockLayout:LayoutAnchorablePane>
</avalonDockLayout:LayoutPanel>
<avalonDockLayout:LayoutPanel Orientation="Horizontal"
x:Name="left2"
DockHeight="12*">
<avalonDockLayout:LayoutPanel x:Name="left21"
Orientation="Vertical"
DockWidth="5*">
<avalonDockLayout:LayoutAnchorablePane DockHeight="8*"
x:Name="left211">
<avalonDockLayout:LayoutAnchorable Title="C"
ContentId="c"
x:Name="c">
<Border Background="Orange" />
</avalonDockLayout:LayoutAnchorable>
</avalonDockLayout:LayoutAnchorablePane>
</avalonDockLayout:LayoutPanel>
<avalonDockLayout:LayoutPanel x:Name="left3"
Orientation="Vertical"
DockWidth="4*">
<avalonDockLayout:LayoutAnchorablePane DockHeight="3*"
x:Name="left31">
<avalonDockLayout:LayoutAnchorable Title="F"
ContentId="F"
x:Name="F">
<Border Background="Yellow" />
</avalonDockLayout:LayoutAnchorable>
</avalonDockLayout:LayoutAnchorablePane>
</avalonDockLayout:LayoutPanel>
</avalonDockLayout:LayoutPanel>
</avalonDockLayout:LayoutPanel>
<!--#endregion-->
<!--#region Main Right Column -->
<avalonDockLayout:LayoutPanel x:Name="rightPanel"
Orientation="Vertical"
DockWidth="3*">
<avalonDockLayout:LayoutAnchorablePane x:Name="right1">
<avalonDockLayout:LayoutAnchorable Title="K"
x:Name="K"
ContentId="K">
<Border Background="DodgerBlue" />
</avalonDockLayout:LayoutAnchorable>
</avalonDockLayout:LayoutAnchorablePane>
</avalonDockLayout:LayoutPanel>
<!--#endregion-->
</avalonDockLayout:LayoutPanel>
<!--#endregion-->
</avalonDockLayout:LayoutRoot>
</avalonDock:DockingManager>
</Grid>
</Window>
The behavior in Design mode is pretty erratic and was hoping someone has experienced this before and found a solution.
I have simplified the layout as much as possible in the above XAML and the problem still occurs.
I have the same issue with Dirkster99's AvalonDock (version 4.70.1) but with Visual Studio 2022 (Version 17.1.1) only. With VS 2019, it works OK.

(Windows phone 8.1) Create rounded image button at windows phone 8.1

I want to create a image button with corner radius 20.0 in windows phone 8.1, but I can not find any solution , anyone can suggest me a way to do this ?
The button look like that :
Try this
<Button HorizontalAlignment="Left" Margin="47,636,0,0" >
<Button.Template>
<ControlTemplate>
<Border BorderBrush="#6BA92A" Background="#6BA92A" CornerRadius="20,20,20,20" BorderThickness="2">
<Button Content="Add to cart"
Background="{TemplateBinding Background}"
Height="65"
Width="348"
FontSize="{TemplateBinding FontSize}"
BorderBrush="#6BA92A">
</Button>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
You can use Border element
<Border BorderBrush="Red" BorderThickness="2" CornerRadius="20" HorizontalAlignment="Left" >
<Button BorderThickness="0" Click="Button_Click" >
<Button.Background>
<ImageBrush ImageSource="Assets/cart.png" Stretch="Uniform"/>
</Button.Background>
</Button>
</Border>
I have resolved that issue, here is my code :
<Rectangle Grid.Row="3" Margin="20,0,20,20" HorizontalAlignment="Stretch" Height="50" RadiusX="10" RadiusY="10" > <Rectangle.Fill>
<ImageBrush Stretch="Fill" ImageSource="/Assets/images/add_cart_btn_bg.png"/>
</Rectangle.Fill> </Rectangle>

Fixed pivot header item?

I use pivot create menu (with 4 item). I want FIXED header 4 item (not move) and change image item header when I move item (same menu facebook on wp8)
This is my code
{<phone:Pivot Height="758" VerticalAlignment="Bottom" Loaded="Pivot_Loaded_2" UnloadedPivotItem="Pivot_UnloadedPivotItem">
<phone:Pivot.Background>
<ImageBrush Stretch="Fill" ImageSource="bg_login_popup_head.png"/>
</phone:Pivot.Background>
<phone:Pivot.HeaderTemplate>
<DataTemplate>
<Image Source="{Binding}" Height="83" Width="94" />
</DataTemplate>
</phone:Pivot.HeaderTemplate>
<!--Pivot item one-->
<phone:PivotItem x:Name="item1" Header = "/Resources/Icon/ic_home_actionbar_red.png" Margin="0,10,0,0" Foreground="#FF19DE84">
<phone:PivotItem.Background>
<ImageBrush Stretch="Fill" ImageSource="background.png"/>
</phone:PivotItem.Background>
<TextBlock HorizontalAlignment="Left" Height="157" TextWrapping="Wrap" VerticalAlignment="Top" Width="337" Margin="61,422,0,0" FontSize="50" Text="Đoi mih mot chut nhe" Foreground="#FFD68F8B"/>
</phone:PivotItem>
<!--Pivot item two-->
<phone:PivotItem Header="/Resources/Icon/ic_love_actionbar_red.png" Margin="0,10,0,-37" >
<phone:PivotItem.Background>
<ImageBrush Stretch="Fill" ImageSource="background.png"/>
</phone:PivotItem.Background>
</phone:PivotItem>
<phone:PivotItem Header="/Resources/Icon/ic_profile_actionbar_red.png" Margin="0,28,0,0">
<phone:PivotItem.Background>
<ImageBrush Stretch="Fill" ImageSource="background.png"/>
</phone:PivotItem.Background>
}
Thanks!
Hope this is what you're looking for?
Tabbed interface with Pivot animation for Windows Phone

How to "Center" listview items in a column

Seem no matter where I put the HorizentalAlignment = "Center" in my ListViewColumn it doesn't effect the outcome.
This is all I have tried so far,
<ListView.View>
<GridView>
<GridViewColumn Header="Device name" Width="120" DisplayMemberBinding="{Binding Path=DeviceName}"/>
<GridViewColumn>
<GridViewColumnHeader Content=" GPS Signal " />
<GridViewColumn.CellTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Center">
<Image Width="13" HorizontalAlignment="Center" Source="{Binding Path=GpsSignalImagePath}"/>
</Grid>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn>
</GridView>
</ListView.View>
</ListView>
As you can see it's mentioned in Grid and also in Image itself but no luck. The result shows up aligned to left as it's shown in the picture below.
Set the HorizontalAlignment inside ItemsPanelTemplate like this
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<Grid HorizontalAlignment="Center"/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
You can try to set HorizontalContentAlignment of ListViewItem from style to alter alingment of cell's content :
<ListView ....>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
</ListView.ItemContainerStyle>
......
......
</ListView>

AvalonDock 2.0 editable header

I'm using Avalondock version 2.0 and set into the header custom editable texbox control.
But when I changed the header text, the message does not invoke to the
ViewModel(see at <Setter Property="Title" Value="{Binding Model.DataContext.Caption, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}").
What can I solve this?
<xcad:DockingManager Grid.Row="1" regions:RegionManager.RegionName="{x:Static common:RegionNames.DesignerRegion}"
Style="{DynamicResource CustomDockingManagerStyle}">
<xcad:DockingManager.DocumentHeaderTemplate>
<DataTemplate>
<behaviors:EditableTextBlock x:Name="EditableTextBlock"
Text="{Binding Path=Title}"
TextBoxBorderColor="#C34442"
TextBlockForegroundColor="{DynamicResource AddButtonBackground}"
TextBoxForegroundColor="#7B3A3A"
TextBoxBackgroundColor="#FFF1E6"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"/>
</DataTemplate>
</xcad:DockingManager.DocumentHeaderTemplate>
<xcad:DockingManager.LayoutItemContainerStyleSelector>
<avalonBehaviors:PanesStyleSelector >
<avalonBehaviors:PanesStyleSelector.DocumentsStyle>
<Style TargetType="{x:Type xcad:LayoutItem}">
<Setter Property="Title" Value="{Binding Model.DataContext.Caption, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
</Style>
</avalonBehaviors:PanesStyleSelector.DocumentsStyle>
</avalonBehaviors:PanesStyleSelector>
</xcad:DockingManager.LayoutItemContainerStyleSelector>
<xcad:LayoutRoot >
<xcad:LayoutPanel >
<!--xcad:LayoutDocumentPaneGroup>
<xcad:LayoutDocumentPane />
</xcad:LayoutDocumentPaneGroup-->
<xcad:LayoutDocumentPane />
<xcad:LayoutAnchorablePane DockWidth="250" >
<xcad:LayoutAnchorable Title="Properties" AutoHideWidth="250">
<ContentControl regions:RegionManager.RegionName="{x:Static common:RegionNames.PropertiesRegion}"/>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorablePane>
</xcad:LayoutPanel>
<xcad:LayoutRoot.BottomSide>
<xcad:LayoutAnchorSide>
<xcad:LayoutAnchorGroup>
<xcad:LayoutAnchorable Title="Log Messages">
<TextBox IsReadOnly="True" Text="{Binding LogMessage}" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"/>
</xcad:LayoutAnchorable>
</xcad:LayoutAnchorGroup>
</xcad:LayoutAnchorSide>
</xcad:LayoutRoot.BottomSide>
</xcad:LayoutRoot>
</xcad:DockingManager>
Thanks