I have:
<FlyoutItem
FlyoutDisplayOptions="AsMultipleItems"
</FlyoutItem>
I would like to have a TabBar in one of the contentPages but I can't get it.
You can use the below.
<Shell FlyoutBehavior="Flyout">
<FlyoutItem Title="Home">
<Tab Title="Tab1">
<ShellContent ContentTemplate="{DataTemplate pages:Tab1}"/>
</Tab>
<Tab Title="Tab2">
<ShellContent ContentTemplate="{DataTemplate pages:Tab2}"/>
</Tab>
</FlyoutItem>
</Shell>
but I can't put it inside my existing FyloutItem, what you put me will
be separated by a gray line and below my menu and it will do a strange
effect replacing all the content.
I did a test, and there is no gray line.
Please refer to the following code:
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="MauiApp1205.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiApp1205"
Shell.FlyoutBehavior="Flyout">
<FlyoutItem Route="animals"
FlyoutDisplayOptions="AsMultipleItems">
<Tab Title="Domestic"
Route="domestic"
>
<ShellContent Route="cats"
Title="Cats"
ContentTemplate="{DataTemplate local:CatsPage}" />
<ShellContent Route="dogs"
Title="Dogs"
ContentTemplate="{DataTemplate local:DogsPage}" />
</Tab>
</FlyoutItem>
<ShellContent
Title="Test"
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />
</Shell>
Related
I create a demo app by Net MAUI, using Flyout to navigate to three Shell page. In Windows is good, but in android, the page goes to blank.
first
go in again
and debug output says MODE_SCROLLABLE + GRAVITY_FILL is not supported, GRAVITY_START will be used instead
in AppShell.xaml
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="NexDroid.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:NexDroid"
xmlns:pages="clr-namespace:NexDroid.Pages"
xmlns:debug="clr-namespace:NexDroid.Pages.Debug"
xmlns:parametes="clr-namespace:NexDroid.Pages.Parameters"
FlyoutBehavior="Flyout">
<ShellContent ContentTemplate="{DataTemplate pages:Connect}" />
<FlyoutItem Title="操作" Route="MainPage">
<ShellContent ContentTemplate="{DataTemplate local:MainPage}" />
</FlyoutItem>
<FlyoutItem Title="调试">
<ShellContent ContentTemplate="{DataTemplate debug:DebugShell}" />
</FlyoutItem>
<FlyoutItem Title="参数">
<ShellContent ContentTemplate="{DataTemplate parametes:ParametersShell}" />
</FlyoutItem>
</Shell>
in MainPage.xaml
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="NexDroid.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:pages="clr-namespace:NexDroid.Pages"
xmlns:operation="clr-namespace:NexDroid.Pages.Operation"
>
<TabBar>
<Tab Title="点动" Route="Operation/Jog">
<ShellContent ContentTemplate="{DataTemplate operation:Jog}" />
</Tab>
<Tab Title="拖拽" Route="Operation/Drag">
<ShellContent ContentTemplate="{DataTemplate operation:Drag}" />
</Tab>
</TabBar>
</Shell>
is there something wrong?
is there i using wrong?
In AppShell.xaml, you can change to this:
...
<Shell.TabBarIsVisible>false</Shell.TabBarIsVisible>
<FlyoutItem Title="操作">
<Tab Title="点动">
<ShellContent Title="点动" ContentTemplate="{DataTemplate operation:Jog}" />
<ShellContent Title="拖拽" ContentTemplate="{DataTemplate operation:Drag}" />
</Tab>
<ShellContent Title="调试" ContentTemplate="{DataTemplate debug:DebugShell}" />
<ShellContent Title="参数" ContentTemplate="{DataTemplate parametes:ParametersShell}" />
</FlyoutItem>
...
I suppose that your mainpage must be a ContentPage and not a Shell as you already have a shell in your app.
If you need different tabs to mainpage, and at the same time you need to get rid off the initial tabs you have to think about how the user will go back to the initial tabs. But if you want all the tabs to be visible both the initial tabs and the additional tabs of the mainpage, maybe is better to redesign the ui and include bottom and top tabs, so all the tabs will be visible to the user. Check the docs here.
This is my first time I try to implement the flyouts menu in Xamarin forms. I created first a blank page and followed the documentation but for some reason the menu is not showing. The tabbar in case you are wondering will be added dynamically that is why it is empty. What might be the problem? Thanks in advance.
<?xml version="1.0" encoding="utf-8" ?>
<Shell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Bufib.Tools"
xmlns:views="clr-namespace:Bufib.Views.FlyoutPages"
x:Class="Bufib.MainPage">
<Shell.ToolbarItems>
<ToolbarItem x:Name="audioOptn" IconImageSource="{local:ImageResource Bufib.Logos.audio.png}" />
</Shell.ToolbarItems>
<!-- NAVIGATION -->
<Shell.FlyoutHeader>
<StackLayout Padding="10">
<Label x:Name="flyoutHeaderLbl" Text="Bufib" FontSize="Header" />
</StackLayout>
</Shell.FlyoutHeader>
<FlyoutItem x:Name="syllabusPage" >
<Tab>
<ShellContent Route="SyllabusPage" ContentTemplate="{DataTemplate views:SyllabusPage}" />
</Tab>
</FlyoutItem>
<FlyoutItem x:Name="historyPage">
<Tab>
<ShellContent Route="HistoryPage" ContentTemplate="{DataTemplate views:HistoryPage}" />
</Tab>
</FlyoutItem>
<FlyoutItem x:Name="managePage">
<Tab>
<ShellContent Route="ManagePage" ContentTemplate="{DataTemplate views:ManagePage}" />
</Tab>
</FlyoutItem>
<FlyoutItem x:Name="errorPage">
<Tab>
<ShellContent Route="ErrorPage" ContentTemplate="{DataTemplate views:ErrorPage}" />
</Tab>
</FlyoutItem>
<FlyoutItem x:Name="aboutPage">
<Tab>
<ShellContent Route="AboutPage" ContentTemplate="{DataTemplate views:AboutPage}" />
</Tab>
</FlyoutItem>
<FlyoutItem x:Name="callUsPage">
<Tab>
<ShellContent Route="CallUsPage" ContentTemplate="{DataTemplate views:CallUsPage}" />
</Tab>
</FlyoutItem>
<!-- END NAVIGATION TABS -->
<!--- TABS -->
<TabBar x:Name="tabBar"></TabBar>
<!--- END TABS -->
</Shell>
The problem was that it was a navigation page. I navigated to it using MainPage = new Navigation(new MainPage()) which causes the problem. So the solution was changing it to MainPage = new MainPage()
I created the extension for Visual Studio 2015 which looks this
But i want to place all the four menus in a category say My Group. Which should like this.
My Group [On click of this the rest of submenus shoud come same as shown in the image]
menu one
menu two
My vsct file looks like this
<Commands package="package">
<Groups>
<Group guid="PackageCmdSet" id="MenuGroup" priority="0x0300">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_ITEMNODE"/>
</Group>
<Group guid="ClassPackageCmdSet" id="ProjectMenuGroup" priority="0x0400">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PROJNODE"/>
</Group>
</Groups>
and i have buttons like this
<Buttons>
<Button guid="PackageCmdSet" id="BranchModelClassId" priority="0x0100" type="Button" >
<Parent guid="PackageCmdSet" id="MenuGroup" />
<Icon guid="guidImages" id="bmpPic1" />
<CommandFlag>DynamicVisibility</CommandFlag>
<Strings>
<CommandName>Test</CommandName>
<ButtonText>Test</ButtonText>
</Strings>
</Button>
How to created a nested menu which i shouwn in the second image ?
Please help me on this.
I finally figured out the way. The change has to be done in the vsct file.
Add menus first inside the Commands
<Menus>
<Menu guid="PackageCmdSet" id="MainMenu" priority="0x0100" type="Menu">
<Parent guid="PackageCmdSet" id="MenuGroup" />
<Strings>
<ButtonText>Nested Menu</ButtonText>
</Strings>
</Menu>
<Menus>
Then add groups
<Groups>
<Group guid="PackageCmdSet" id="MenuGroup" priority="0x0200">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_ITEMNODE"/>
</Group>
<Group guid="PackageCmdSet" id="CommandsMenuGruop" priority="0x0300">
<Parent guid="PackageCmdSet" id="MainMenu"/>
</Group>
<Groups>
The button should be like this
<Buttons>
<Button guid="PackageCmdSet" id="ClassId" priority="0x0100" type="Button">
<Parent guid="PackageCmdSet" id="CommandsMenuGruop" />
<Icon guid="guidImages" id="bmpPic1" />
<CommandFlag>DynamicVisibility</CommandFlag>
<Strings>
<CommandName>Command</CommandName>
<ButtonText>Item 1</ButtonText>
</Strings>
</Button>
<Buttons>
I am developping a windows 8.1 application and since few days I am struggling with a problem.
Here is my probem:
I have a tfs project and via my application I want to follow it (displaying the state, created by, changed by,etc) using tfs odata.
Here is the xml file obtained :
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="https://tfsodata.visualstudio.com/DefaultCollection/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
<title type="text">WorkItems</title>
<id>https://tfsodata.visualstudio.com/DefaultCollection/Projects('project1')/WorkItems/</id>
<updated>2014-05-02T14:52:17Z</updated>
<link rel="self" title="WorkItems" href="WorkItems" />
<entry m:etag="W/"datetime'2014-03-12T19%3A54%3A38.193%2B00%3A00'"">
<id>https://tfsodata.visualstudio.com/DefaultCollection/WorkItems(1)</id>
<title type="text">ProjetTest</title>
<summary type="text"></summary>
<updated>2014-03-12T19:54:38Z</updated>
<author>
<name />
</author>
<link rel="edit" title="WorkItem" href="WorkItems(1)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href="WorkItems(1)/Attachments" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Links" type="application/atom+xml;type=feed" title="Links" href="WorkItems(1)/Links" />
<category term="Microsoft.Samples.DPE.ODataTFS.Model.Entities.WorkItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:Id m:type="Edm.Int32">1</d:Id>
<d:Project>project1</d:Project>
<d:Type>Product Backlog Item</d:Type>
<d:WebEditorUrl>https://xxxx.visualstudio.com/web/wi.aspx?pcguid=f2ba9200-f167-43e8-a92e-d36b1bc1b561&id=1</d:WebEditorUrl>
<d:AreaPath>ptoject1</d:AreaPath>
<d:IterationPath>project1</d:IterationPath>
<d:Revision m:type="Edm.Int32">2</d:Revision>
<d:Priority m:null="true" />
<d:Severity m:null="true" />
<d:StackRank m:type="Edm.Double">0</d:StackRank>
<d:AssignedTo></d:AssignedTo>
<d:CreatedDate m:type="Edm.DateTime">2014-03-12T19:54:25.783+00:00</d:CreatedDate>
<d:CreatedBy>xxxxx</d:CreatedBy>
<d:ChangedDate m:type="Edm.DateTime">2014-03-12T19:54:38.193+00:00</d:ChangedDate>
<d:ChangedBy>xxxxx</d:ChangedBy>
<d:ResolvedBy m:null="true" />
<d:Title>ProjetTest</d:Title>
<d:State>New</d:State>
<d:Reason>New backlog item</d:Reason>
<d:CompletedWork m:type="Edm.Double">0</d:CompletedWork>
<d:RemainingWork m:type="Edm.Double">0</d:RemainingWork>
<d:Description></d:Description>
<d:ReproSteps m:null="true" />
<d:FoundInBuild m:null="true" />
<d:IntegratedInBuild></d:IntegratedInBuild>
<d:AttachedFileCount m:type="Edm.Int32">0</d:AttachedFileCount>
<d:HyperLinkCount m:type="Edm.Int32">0</d:HyperLinkCount>
<d:RelatedLinkCount m:type="Edm.Int32">0</d:RelatedLinkCount>
<d:Risk m:null="true" />
<d:StoryPoints m:type="Edm.Double">0</d:StoryPoints>
<d:OriginalEstimate m:type="Edm.Double">0</d:OriginalEstimate>
<d:BacklogPriority m:type="Edm.Double">1000000000</d:BacklogPriority>
<d:BusinessValue m:type="Edm.Int32">0</d:BusinessValue>
<d:Effort m:type="Edm.Double">0</d:Effort>
<d:Blocked m:null="true" />
<d:Size m:type="Edm.Double">0</d:Size>
</m:properties>
</content>
</entry>
<entry m:etag="W/"datetime'2014-03-24T12%3A07%3A56.397%2B00%3A00'"">
<id>https://tfsodata.visualstudio.com/DefaultCollection/WorkItems(2)</id>
<title type="text">test2</title>
<summary type="text"></summary>
<updated>2014-03-24T12:07:56Z</updated>
<author>
<name />
</author>
<link rel="edit" title="WorkItem" href="WorkItems(2)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href="WorkItems(2)/Attachments" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Links" type="application/atom+xml;type=feed" title="Links" href="WorkItems(2)/Links" />
<category term="Microsoft.Samples.DPE.ODataTFS.Model.Entities.WorkItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:Id m:type="Edm.Int32">2</d:Id>
<d:Project>project1</d:Project>
<d:Type>Product Backlog Item</d:Type>
<d:WebEditorUrl>https://xxxxx.visualstudio.com/web/wi.aspx?pcguid=f2ba9200-f167-43e8-a92e-d36b1bc1b561&id=2</d:WebEditorUrl>
<d:AreaPath>project1</d:AreaPath>
<d:IterationPath>project1</d:IterationPath>
<d:Revision m:type="Edm.Int32">4</d:Revision>
<d:Priority m:null="true" />
<d:Severity m:null="true" />
<d:StackRank m:type="Edm.Double">0</d:StackRank>
<d:AssignedTo></d:AssignedTo>
<d:CreatedDate m:type="Edm.DateTime">2014-03-12T20:16:49.827+00:00</d:CreatedDate>
<d:CreatedBy>xxxx</d:CreatedBy>
<d:ChangedDate m:type="Edm.DateTime">2014-03-24T12:07:56.397+00:00</d:ChangedDate>
<d:ChangedBy>xxxx</d:ChangedBy>
<d:ResolvedBy m:null="true" />
<d:Title>test2</d:Title>
<d:State>Committed</d:State>
<d:Reason>Additional work found</d:Reason>
<d:CompletedWork m:type="Edm.Double">0</d:CompletedWork>
<d:RemainingWork m:type="Edm.Double">0</d:RemainingWork>
<d:Description></d:Description>
<d:ReproSteps m:null="true" />
<d:FoundInBuild m:null="true" />
<d:IntegratedInBuild></d:IntegratedInBuild>
<d:AttachedFileCount m:type="Edm.Int32">0</d:AttachedFileCount>
<d:HyperLinkCount m:type="Edm.Int32">0</d:HyperLinkCount>
<d:RelatedLinkCount m:type="Edm.Int32">0</d:RelatedLinkCount>
<d:Risk m:null="true" />
<d:StoryPoints m:type="Edm.Double">0</d:StoryPoints>
<d:OriginalEstimate m:type="Edm.Double">0</d:OriginalEstimate>
<d:BacklogPriority m:type="Edm.Double">999968378</d:BacklogPriority>
<d:BusinessValue m:type="Edm.Int32">0</d:BusinessValue>
<d:Effort m:type="Edm.Double">0</d:Effort>
<d:Blocked m:null="true" />
<d:Size m:type="Edm.Double">0</d:Size>
</m:properties>
</content>
</entry>
</feed>
my class:
paste special as xml classes (from the xml above)
my function :
public IEnumerable<TfsEntitiesXml.feed> Deserialize()
{
string xml = "https://tfsodata.visualstudio.com/DefaultCollection/Projects('xxxx')/WorkItems".Trim();
XmlSerializer serilaizer = new XmlSerializer(typeof(TfsEntitiesXml.feed));
//string xml = "";
byte[] buffer = Encoding.UTF8.GetBytes(xml);
var stream = new MemoryStream();
stream.WriteAsync(buffer, 0, buffer.Length);
IEnumerable<TfsEntitiesXml.feed> result = (IEnumerable<TfsEntitiesXml.feed>)serilaizer.Deserialize(stream);
return result;
}
and the xaml
<ListView x:Name="itemsListView"
SelectionMode="None"
ItemsSource="{Binding TfsList}" >
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock
Foreground=
"{StaticResource ListViewItemOverlayForegroundThemeBrush}"
Style="{StaticResource TitleTextStyle}" Height="60"
TextWrapping="Wrap"
Margin="15,5,15,0">
<Run Text="{Binding Title}" ></Run>
<Run Text="{Binding State}" ></Run>
</TextBlock>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
var projects = tfsConnector.Deserialize();
DefaultViewModel["TfsList"] = projects;
When I run I get this exception
An exception of type 'System.InvalidOperationException' occurred in System.Xml.dll but was not handled in user code
Additional information: There is an error in XML document (0, 0).
I am struggling with this problem since few days now.
Can someone help me please?
Thank you
You should simply make a service reference to the tfsodata service, this way you will get a typed reference and don't have to mess with the xml.
See this blogpost
///This is my Agent.sitemap
<siteMapNode url="default.aspx#" title="Start" description="Start">
<siteMapNode url="~/dirCommon/default.aspx" title="Home" description="Home" />
<siteMapNode url="dirAgent/profile.aspx#" title="Agent" description="Agent">
<siteMapNode url="dirAgent/profile.aspx" title="My Profile" description="Agent:My Profile" />
<siteMapNode url="dirUser/account.aspx" title="My Account" description="Agent:My Account" />
<!--<siteMapNode url="dirUser/downloads.aspx" title="Downloads" description="Agent:Downloads" />-->
</siteMapNode>
<siteMapNode url="dirAgent/default.aspx" title="Calls" description="Calls">
<siteMapNode url="dirAgent/CallQueue.aspx" title="Call Queue" description="Agent:Call Queue" />
<siteMapNode url="dirAgent/myCalls.aspx" title="My Calls" description="Agent:My Calls" />
<siteMapNode url="dirAgent/followupcalls.aspx" title="Follow-Up" description="Agent:Follow-Up" />
<siteMapNode url="dirAgent/calls.aspx" title="Call History" description="Agent:Call History" />
</siteMapNode>
<siteMapNode url="dirAgent/default3.aspx" title="Environment" description="Environment">
<siteMapNode url="dirAgent/facilities.aspx" title="Facilities" description="Agent:Facilities" />
<!-->
<siteMapNode url="dirAgent/contacts.aspx" title="Contacts" description="Agent:Contacts" />
<!-->
</siteMapNode>
</siteMapNode>
//This Web.sitemap
<siteMapNode url="~/dirCommon/default.aspx" title="Home" description="Home" />
//when i run application from iis getting an error "AGENT.sitemap required by XmlSiteMapProvider does not exist."
Looks like your XmlSiteMapProvider is configured in the web.config (or code) to use your Agent.sitemap instead of the default ~/web.sitemap. check if that reference and the actual location of the Agent.sitemap are correct!