<render-mode> not working with dynamic Material UI - moqui

I use the <render-mode> tag to include some html in my screen:
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-2.1.xsd"
require-authentication="anonymous-all">
<widgets>
<label type="h1" text="Hello world!"/>
<render-mode>
<text type="html,vuet" location="component://tutorial/template/hello.html"/>
</render-mode>
<label type="h1" text="after Hello world!"/>
</widgets>
</screen>
The incuded hello.html file is shown fine using the "standard UI" or "dynamic Bootstrap UI", but it doesn't show when using the "dynamic Material UI".
Is there a way to enable this? I much prefer the look and navigation of the dynamic Material UI.
Thank you!

The reason it doesn't show under qapps is that qapps uses a new render mode 'qvt' just like vapps uses the render mode 'vuet'. To make it show under /qapps just change:
<text type="html,vuet" ...
to:
<text type="html,vuet,qvt" ...

Related

How can I navigate the blazor pages with the press of a xaml button?

So here is my generally idea:
I have a flyout page in which i want to press different buttons to load different blazor pages in the flyout.details. The goal is to replace the default navbar of the blazor example with native elements of the different frameworks in the .NET MAUI XAML. (Image) My first thought was accessing the navigationManager of the blazor pages but no idea how. Does that even makes sense? I feel like I am missing sth very crucial because it seems to be a very natural thing to do with .net Maui Blazor.
Important to understand is that i want to stay on the same xaml page. I just want to change the loaded Blazor page without the need to define the nav at in the Blazor page.
I tried to access it via injection,
which kinda confused me but tried it any ways (got it from a forum). I feel like I am not understanding something fundamental.
XAML:
<FlyoutPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiTest"
x:Class="MauiTest.MainPage"
BackgroundColor="{DynamicResource PageBackgroundColor}">
<FlyoutPage.Flyout>
<ContentPage Title="FlyoutMenu">
<VerticalStackLayout>
<Label x:Name="TestLabel"
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
<Button Text="Counter" Clicked="OnCounterClicked" x:Name="Counter" />
<Button Text="Test" Clicked="OnTestButtonClicked" x:Name="TestButton"/>
<WebView BackgroundColor="red" Source="http://0.0.0.0/app/counter" />
</VerticalStackLayout>
</ContentPage>
</FlyoutPage.Flyout>
<FlyoutPage.Detail>
<ContentPage>
<BlazorWebView x:Name="blazorWebView" HostPage="wwwroot/index.html">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type local:Main}" />
</BlazorWebView.RootComponents>
</BlazorWebView>
</ContentPage>
</FlyoutPage.Detail>
For the methode behind it I don't really have any idea...
C#:
private void OnTestButtonClicked(object sender, EventArgs e)
{
//Navigating to a site
}
Don't let yourself irritate from the other buttons: I am playing around.
To replace the nav bar
Maui Blazor have designed the structure for us. The easiest way i think is to modify it.
The NavMenu.razor (default blazor template) define the appearance and structure of the navigation bar. You could modify it.
<div class="sidebar">
<NavMenu />
</div>
Another way is that you do it like .net maui FlyoutPage. In MainPage
<FlyoutPage.Flyout>
<MauiPages:FlyoutMenuPage x:Name="flyoutPage" />
</FlyoutPage.Flyout>
<FlyoutPage.Detail>
<NavigationPage>
<x:Arguments>
<local:ContactsPage />
</x:Arguments>
</NavigationPage>
</FlyoutPage.Detail>
I have tested it and it worked well just like the official docs.
For more info, you could refer to FlyoutPage and for sample code Xamarin flyout doc could be help
2.I don't think we could navigate from a maui page to razor component as their route ways are much different. For a walkaround, you could wrap razor component in a maui contentpage.
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiBlazor"
>
<BlazorWebView HostPage="wwwroot/index.html">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type local:Main}" />
</BlazorWebView.RootComponents>
</BlazorWebView>
</ContentPage>
And then use maui navigation:
App.Current.MainPage.Navigation.PushAsync(new MauiPages.MyPage());
========origin answer============
Seems you want to close the sidebar created by Blazor. That's MainLayout.razor in Shared folder. You could simply remove the following line:
<div class="sidebar">
<NavMenu />
</div>
Then the default sidebar would disappear.
if you want navigate, you could try the following:
App.Current.MainPage.Navigation.PushAsync(new MauiPages.MyPage());
Hope it works for you.

How to add content page or view before tabbed page

I want to add Page/View before TabbedPage, how can I do that?
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:TestProject.TabbedPages"
x:Class="TestProject.ItemPage"
Title = "Home Page">
<TabbedPage.Children>
<views:AprovedLeaves Title="Approved leaves"/>
<views:PendingLeaves Title="Pending leaves"/>
<views:DeniedLeaves Title="Denied leaves"/>
</TabbedPage.Children>
</TabbedPage>
Above code showing output like this
But I need some space before tabs. Like this
I would suggest you use the Segmented Control Plugin for this look for Plugin.Segmentedon Nuget and install Plugin.SegmentedControl.NetStandard
Initialize it on iOS something like this:
SegementedControlRenderer.Initialize();
Then use it in XAML like this
<control:SegmentedControl x:Name="SegmentedControl" SelectedSegment="{Binding SegmentSelection}" TintColor="White" SelectedTextColor="BlueViolet" DisabledColor="Gray" Margin="8,8,8,8">
<control:SegmentedControl.Children>
<control:SegmentedControlOption Text="Item 1" />
<control:SegmentedControlOption Text="Item 2" />
<control:SegmentedControlOption Text="Item 3" />
<control:SegmentedControlOption Text="Item 4" />
</control:SegmentedControl.Children>
</control:SegmentedControl>
A step by step guide is available on this C# corner blog
Feel free to revert in case of queries

SAPUI5 - Responsive sap.m.Table

I created a sap.m.table with its header headerToolbar.
In the header, I put the title and two SelectList separated by a ToolbarSpacer.
The problem is that when the screen size is small the elements on the headerToolbar don't go back to the next line and are truncated ...
On a large screen:
On a small screen:
I want the header to be responsive, that is the elements should go to the next line if there is no sufficient space.
Here is the code:
<headerToolbar height="auto">
<Toolbar height="auto">
<content>
<Title id="tableHeader" text="..."/>
<ToolbarSpacer />
<Label text="..." lableFor="sl1"/>
<SelectList id="sl1"
enabled="true">
<core:Item key="..." text="..." />
<core:Item key="..." text="..." />
</SelectList>
<ToolbarSpacer />
<Label text="..." lableFor="sl2"/>
<SelectList id="sl2"
enabled="true">
<core:Item key="..." text="..." />
<core:Item key="..." text="..." />
</SelectList>
<ToolbarSpacer />
</content>
</Toolbar>
</headerToolbar>
Why you don't use OverflowToolbar instead of Toolbar?
Is the official responsive Toolbar
https://sapui5.hana.ondemand.com/explored.html#/sample/sap.m.sample.OverflowToolbarFooter/preview
If you don't like it and want this "pop-in" behaviour you have described, I guess you can put a FlexBox inside your Toolbar and set the direction property depending on the "device" model.
Using expression binding will be something like this:
new sap.m.FlexBox({
direction: "{= ${device>/isPhone} ? 'Column' : 'Row' }",
items: [
//Your content goes here
]
})
More here: https://sapui5.hana.ondemand.com/#docs/guide/69a8e469fbde46e7b8916250080effbd.html
You can enable horizontal table scrolling in the css:
.enableTableScrolling {
overflow-x: scroll;
}
After that table will not be truncated.

How to styling header & button with StyleProvider at the same page?

I've struggling for two days to styling components on Native Base with <StyleProvider>. I want to change background color of header and add custom style property on the button.
<Container>
<Header /> /*change backgroundColor*/
<Content>
<Button viewDetail block> /*add 'viewDetail' as custom style property */
<Text>Button</Text>
</Button>
</Content>
</Container>
I think, I have the answer for my own question.
Import all components from 'native-base-theme/components/' instead of variables.
The code will be like this
import getTheme from './native-base-theme/components';
and add <StyleProvider>, then add prop style <StyleProvider style={getTheme()}>.
There are many ways of doing this. One way would be to follow the instructions given here. Alternatively, you can change the button theme file and add a similar style property like success shown here.
I hope this will help you,
You must be using NativeBase2
<StyleProvider style={getTheme(commonColor)}>
<Header>
<Left>
<Button transparent>
<Icon name="arrow-back" onPress={() => this.props.routerActions.pop()} />
</Button>
</Left>
<Body>
<Title>Profile</Title>
</Body>
<Right></Right>
</Header>
</StyleProvider>
For ejecting theme,
Just open this link and follow
http://nativebase.io/docs/v2.0.0/customize#themingNativeBaseApp
Now If you want to customise just look for
native-base-theme/components/Header.js
native-base-theme/variables/commonColor.js

titanium alloy raised tab bar with raised center button - dailybooth style

I'm trying to customize my alloy TabGroup to look like the image below (with no luck). no "height" properties on Tab item in the default documentation and with my current version of titanium 3.4.0 can't add View to TabGroup.
anybody know how to create a raised center button using alloy?
that's my index.xml view
<Alloy>
<TabGroup tabsBackgroundColor="white" barColor="#f15b26" activeTabIconTint="black" tintColor="white">
<Require src="home" nr="1" />
<Require src="play" nr="2" />
<Tab icon="/menu/logo.png" height="100">
<Window title="" id="">
<Label></Label>
</Window>
</Tab>
<Require src="chat" nr="3" />
<Require src="config" nr="4" />
</TabGroup>
</Alloy>
you can use an image in the middle of the that exceed the height of the bar.
When we implemented this solution in the past, we did a completely custom tabBar. I dont think you can accomplish what you are trying to do with the base tabBar control