String formatting in Silverlight - silverlight-4.0

I'm trying to do binding to a text block in silverlight, but when I'm writing a StringFormat, I'm getting this error-
The property 'StringFormat' was not found in type 'Binding',
Here is my code:
Text="{Binding Text, ElementName=FirstNameTxt, StringFormat='Hi {0}!'}"
(I'm working with Silverlight 4)
And by the way, can anybody recommend me a good sight for learning silverlight??
Thanks !

Click Here
Click on the link above u will easily understand how to use string format in silverlight

Related

Unable to find property "FrozenColumnCount" using Syncfusion with MAUI and .NET 7

I'm attempting to add the FrozenColumnCount ​property into my application. I add the appropriate line of code to my xaml ​file(seen in the final line of my SfDataGrid Tag)
<syncfusion:SfDataGrid
ItemsSource="{Binding ProductItems}"
ColumnWidthMode="Auto"
GridLinesVisibility="Both"
HeaderGridLinesVisibility="Both"
AutoGenerateColumnsMode="None"
FrozenColumnCount="1"
>
//column data
</syncfusion:SfDataGrid>
However when I build my app, I receive the following error
​The property 'FrozenColumnCount' was not found in type 'SfDataGrid'
I've only added that singular line to my xaml file to achieve the needed result. Is there anything else I need to add to get it to work ?
The syncfusion .net Maui DataGrid currently does not support frozen rows and columns. To learn about future plans for the .Net Maui DataGrid, please refer to the relevant documentation.
https://help.syncfusion.com/maui/datagrid/migration#upcoming-features

UWP Databinding Error

In a UWP, I use the "CollectionViewSource" in a xaml file, and when I want to bind the source for it, it doesn't work and the error information is
Input string was not in correct format
What can I do for solving this problem ?
You have to parse the json file into a collection from the corresponding type, then bind to that collection.
Hope it helps you out.

How to fill a textbox from a website using webbrowser

I'm new at Visual Basics and I'm trying to fill the forms of the following website:
http://www3.dataprev.gov.br/cws/contexto/hiscre/
I tried using this line of code:
WebBrowser1.Document.GetElementById("nome").SetAttribute("Value", "Test")
However, whenever I try I got the following error:
A first chance exception of type 'System.NullReferenceException'
occurred.
I would appreciate if someone could help me to accomplish this, it would save me a lot of time if I could automate this task.
Thank you in advance, Daniel.
WebBrowser1.Document.GetElementById("nome").InnerText = Test
That will select the input named "nome" and fill it with the text "Test"
Hope this helps.
According to Microsoft documentation, the SetAttribute function your are using is case sensitive.
You'll need to replace "Value" for "value".
WebBrowser1.Document.GetElementById("nome").SetAttribute("value", "Test")
However, the kind of error message you are getting seems to occur before the call to the SetAttribute function. Go in debug mode and make sure that every objects used before the SetAttribute function are not null.
You need to be using a combination of WebClient and HtmlAgilityPack. See these examples:
How can I download HTML source in C#
How to use HTML Agility pack

Page Navigation in Windows 8 XAML (without using code behind)

For my windows 8 application i am trying to navigate between pages with out using code behind.
For example, i have one image in my UI without creating tapped event for that image i need to navigate to another page,
<Image Source="ms-appx:///Assets/Logo.png" Width="155" Height="110" Tapped="{ // Navigation method here }"/>
Is it possible to navigate between pages like this...? If possible, how can i get this to work??
XAML is just a declarative language without action part so code behind is an essential part of it.
All interactions work via events and event can be handled in a code behind only. So what you want is not possible with XAML(at least with WinRT XAML).
If you are asking if you can specify the code inside the .xaml file, then no, that is not possible.
If you are asking if you can avoid adding code to the .xaml.cs file, then yes, that is possible. You will still need to specify a method but it can even be done as a simple lambda. You will need to use the Command hooks rather than the Event Hooks, e.g.
<Button Command="{Binding GoConnectionCommand}" ... />
The code for this command is usually defined in the ViewModel as part of the MVVM pattern, and Josh Smith explains it far better than I will.
AlSki mentioned using a ViewModel. Although technically the ViewModel is not part of the "code behind" for the XAML file, it's still code and I believe you were asking for a no code solution.
ixSci is correct that there is no way to do this out of the box without code behind in WinRT XAML.
In full WPF it's possible to do this using a behavior called NavigateToScreenAction. You can read about it here. Unfortunately behaviors don't ship out of the box with WinRT, but they can be added back in by an open source project called WinRtBehaviors.
There is no NavigateToScreenAction behavior for WinRT, but one could be created. There is a good article on creating behaviors with the library here. It will obviously require code to create the behavior, but after it's created you could use it in XAML without any code.
Really, the short answer is it's not possible to navigate without code on WinRT.
Dev support, design support and more awesome goodness on the way: http://bit.ly/winappsupport

According to Datatype,Dynamically Create Control & Using those Control

I want to do a application in silverlight that contains follwing things
According to the datatype it receive from the class(which i am giving through wcf service)
it should create the control.
If it encounters string then a text box should be created dynamically.
If it encounters bool then a radiobutton should be created.
I want to acess those dynamically created controls.(as name is no static to refer in FindName())
How can i achive that.
Please help me with any related link or any code.
Thanks
In WPF, there's something called TemplateSelector, which does what you're asking for. In Silverlight, you have to write it yourself. This should help you.