How to write Source for image from Resources/Images subfolder - xaml

I have two PNG-files:
Resoucres/Images/image1.png and Resoucres/Images/subfolder/image2.png
so, I want to set they as Source for Image:
when I set 1st image:
<Image ... Source="image1.png" />
all working correctly, but when I try to set 2nd image:
<Image ... Source="subfolder.image2.png" />
image isn't displaying.
So, how I need to write the path of the 2nd image?

An image can be added to your app project by dragging it into the Resources\Images folder of the project, where its build action will automatically be set to MauiImage.
Images can also be added to other folders of your app project. However, in this scenario their build action must be manually set to MauiImage in the Properties window.
So you can right click the image2.png file select the properties then change the Build Action to MauiImage and you can use the image directly.
<Image ... Source="image2.png" />

Related

JSF2 custom component, parameter autocompletion with a local file path

My First Question, after years, thank you all and stackoverflow ;-)
I code a new Component for JSF2 and use it to include other templates.
It works perfectly for me.
<cc:interface>
<cc:attribute name="src" type="java.lang.String" required="true"/>
<cc:attribute name="addOption" type="java.util.List"/>
</cc:interface>
<cc:implementation>
<cc:insertChildren />
<ui:include src="#{BeanAnything.convert(cc.attrs.src, cc.attrs.addOption)}" />
</cc:implementation>
But i cant complete the Parameter src via auto completion in intellij or netbeans with "strg + space" or whatever other will use.
It should be used like the ui:include on src parameter.
Any Ideas ?
That's what I want to achieve only with my own componente gg:include
See Example

Using multiple string resources from .resw file into ContentDialog

I would like to set the PrimaryButtonText, SecondaryButtonText and Title attributes of a ContentDialog with strings from my .resw file. Unfortunately Ι can do this only for one attribute using x:Uid, since setting x:Uid two times inside ContentDialog can not be accepted. I even tried to do something like that:
<ContentDialog>
<ContentDialog.PrimaryButtonText x:Uid="DialogConfirm" />
<ContentDialog.SecondaryButtonText x:Uid="DialogCancel" />
</ContentDialog>
But I got an exception
XBF generation error code 0x09c8
Is there any way to accomplish this?
Set x:Uid only for ContentDialog then in resources file set apropriate properties (take a look at MSDN):
<ContentDialog x:Uid="myDialog">
<!--your dialog-->
</ContentDialog>
In Resources.resw set:
myDialog.PrimaryButtonText -> text for primary button
myDialog.SecondaryButtonText -> text for secondary button
As for more guidelines and help, see MSDN.

Display image on right side of header text in XamMenu in silverlight page

I have created a XamMenu in my silverlight page. It consists of 4 options in it. The header for the first item is 'order'. I am using xamMenuItem.icon to add an image on the right side of the header text. But it is always coming on the left side of the header text. How can I do that? Please help.
My xaml code id like this:
<ig:XamMenu x:Name="xamOrderMenu" Height="22" Width="120" ExpandOnHover="True" Canvas.Left="361" Canvas.Top="10">
<ig:XamMenuItem Header="Order" SubmenuPreferredLocation="Bottom" Background="LightGray" FontWeight="Bold" Cursor="Hand">
<ig:XamMenuItem.Icon>
<Image Source="/Asset.View;component/Images/downarrow.PNG"/>
</ig:XamMenuItem.Icon>
<ig:XamMenuItem Header="Order1" StaysOpenOnClick="True" Background="LightGray" Click="ExportToExcel_Click" Cursor="Hand"/>
<ig:XamMenuItem Header="Order2" Background="LightGray" Click="DownloadFundCountTemplate_Click" Cursor="Hand"/>
<ig:XamMenuItem Header="Order3" Background="LightGray" Click="UploadTemplate_Click" Cursor="Hand"/>
<ig:XamMenuItem Header="Order4" Background="LightGray" Click="SearchAndExportToExcel_Click" Cursor="Hand"/>
</ig:XamMenuItem>
You're going to need to retemplate the XamMenuItem to place the icon in a different spot. In the default template, the XamMenuItem is seperated into 3 columns. The icon is placed into the left-most column, header text in the center and the child indicator in the right-most column.
If you have the Infragistics product installed you have access to the default template. You can find it here:
C:\Program Files (x86)\Infragistics\NetAdvantage (release version #)\Silverlight\DefaultStyles\XamMenu
Open the generic.xaml file and do a search for XamMenuItem and the first thing that comes up should be the style for it. The template can be found there. Add this style and its dependencies to your project and then make the necessary adjustments to place the icon on the right side of the header text. You can then assign this style to your XamMenuItems.

Listview webpart in site definition makes it all fail

I have made a listdefinition which I've put in to a web scoped feature which I've added to WebFeatures in my sitedefinition. In my sitedefinition I've added a list view web part which shall display the list created through the listdefinition. My issue is that when I add the list's name to the List property in the list view web part like so:
<View List="OrderList" BaseViewID="1" WebPartZoneID="Footer" WebPartOrder="2">
</View>
the process of creating the new sub site fails because of this alone. I have 2 other lists which is added to the sitedefinition in the exact same way
<View List="Documents" BaseViewID="1" Type="HTML" WebPartZoneID="Footer" WebPartOrder="1">
</View>
<View List="108" BaseViewID="3" WebPartZoneID="Footer" ContentTypeID="0x012001" WebPartOrder="4">
</View>
The only difference is that those 2 lists are standard sharepoint Documents library and Discussion board. If I remove the custom list's list view web part the entire flow works correctly, but as soon as I add it the entire thing fails.
I've created the listdefinition through VS2010 own listdefinition template etc and I haven't touched a thing. Only changed the name in the List Instance and made sure everything matched in the Elements.xml and Schema.xml files
What is the Url attribute of your ListInstance?
Because the List attribute of the View element must match the Url from the ListInstance. For example, if your ListInstance is defined as:
<ListInstance
FeatureId="00000000-0000-0000-0000-000000000000"
TemplateType="0000"
Title="My Test List"
Url="Lists/OrderList">
</ListInstance>
then your View must be:
<View List="Lists/OrderList" BaseViewID="1" WebPartZoneID="Footer" WebPartOrder="2">
</View>

How can I pass parameters to a loaded swf application?

When I load an swf application using SWFLoader in Flex 4, how can I pass parameters to that application?
I've never tried this, but it looks like you can append them directly to the SWFLoader's source as a query string:
<mx:SWFLoader source = "map/us.swf?data_file=map/senate.xml" id="mapLoader" width="300" height="100" />
And retrieve them in the loaded SWF with:
var your_param:String = this.loaderInfo.parameters.data_file;
trace(your_param);
Source