How to get text 'shadow' effect in Silverlight Toolkit themes to work in my project - silverlight-4.0

I am using the jetpack theme in my silverlight project. Everything is picking up the styles except I do not get the subtle text shadow effect that is visible on all the controls on the jetpack demo page.
Here is a screenshot - my project on the left, the demo site on the right.
Is there anything I have to do to enable the effect?

You have to use the label control in the toolkit.
Do this:
xmlns:label="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
then this
<label:Label>Icon</label:Label>

Related

Are there any instruments to watch screen layout in React Native without running app?

I familiarized with Android development and started to read some information about React Native. And one of the problem which I faced with is that I can't see the screen layout.
In Android Studio, for example, I could see the design of my XML layout without running app. Maybe there are such instruments in React Native, but I didn't see them in WebStorm nor VSCode. Maybe I am wrong and they exist, so, can you help me to find them in such situation?
Some modules format the xml document in vscode,
but others have previewable tools.
XML TOOLS
Extension Settings
xmlTools.enableXmlTreeView: Enables the XML Tree View for XML
documents.
xmlTools.enableXmlTreeViewMetadata: Enables attribute and child
element counts in the XML Document view.
xmlTools.enableXmlTreeViewCursorSync: Enables auto-reveal of
elements in the XML Document view when a start tag is clicked in the
editor.
xmlTools.enforcePrettySelfClosingTagOnFormat: Ensures a space is
added before the forward slash at the end of a self-closing tag.
...
I also had the same problem where there is no layout view in VSCode like in Android Studio. My suggestion is to mock out your View containers with coloured boxes. This is an example of designing a screen's header, so I'm making sure the spacing and sizing is all good:

Button styling not not respecting styleName=""

I am using the latest install of ShoutemUI 0.21.3 and RN 0.42.2. All buttons just have a white background. I am not using Shoutem Themes right now. I have tried styleName="confirmation" and still just a white button and no border. Am I missing something?
Here is the code on the left and the results on the right in the simulator.
Here is a screenshot of my imports.
The UI package has a theme.js file with all these styleName's. In order to utilize it, you need #shoutem/theme installed. It's a dependency of #shoutem/ui.
Furthermore, the dark styleName is obsolete. You should utilize secondary instead for the desired effect.

Xamarin: How do I set a placeholder image in my Image element in XAML?

In Android, it is quite easy to set a image placeholder for development purposes in an imageview.
All one would do is use the tools:src for the placeholder image during development so you could see it in your layout design preview and your actual image you would put into your android:src
. Frequently, you don't set the android:src put would populate that imageview with images that you download off the internet once you connect your app to the net:
<ImageView
android:layout_width="28dp"
android:layout_height="28dp"
android:src=#drawable/activated_icon"
tools:src="#mipmap/white_activated_icon" />
In Xamarin, you have this to display images:
<Image Source="http://lorempixel.com/1920/1080/nature/3" />
Once the app connects, the image is downloaded from the internet and displayed. How do I put in a placeholder image for development purposes (similar to the way you would do it through tools:src in android) so I can see it within the layout design previews?
I'm assuming you want to achieve this with Xamarin Forms, as you referring to XAML in the question title.
Or possibly you are referring to the Xamarin Forms Previewer? In that case, disregard the following answer. You can only use local images in the Previewer as far as I can tell.
Answer in case the question is related to runtime Xamarin Forms
There is no standard option to do this in Xamarin Forms. Take a look at this example suggested by Stephane Delcroix from the Xamarin Forums. The important part of this approach is to stack 2 images on top of each other in a grid. 1 is the placeholder that is placed beneath the image that is being loaded, like this:
var grid = new Grid();
grid.RowDefinitions.Add (new RowDefinition());
grid.Children.Add (image);
grid.Children.Add (placeholderImage);
As an alternative option, WebImage of Xamarin Forms Labs allows an option for a DefaultImage, but I'm not sure if that shows immediately. See this class for the code of the Web Image. Keep in mind that Xamarin Forms Labs is no longer under active maintenance.
Of course you can also write a custom renderer. Maybe based on the Xamarin Forms Labs example.
I use FFImageLoading for this Case.
Just install the Nuget Package and Use the "CachedImage" in XAML.
<ff:CachedImage Source="your url" Placeholder="placeholder while loading"/>
You donĀ“t need to download (and cache) the Image manually then. It will automatically displayed when the download is done.
You can use local files (from Resources or Drawable) and files from HTTP/HTTPS.

Changing the chrome of a Windows 10 Universal XAML app

I would like to modify the design of the chrome and top menu panel of my app where the close and minify icons are.
How do I do this and in what XAML file? Should it be done in App.xaml, or in my main page's xaml file? I can find instructions on how to do this in a WPF app, but the concepts don't seem to carry over to Univeral App XAML.
As far as I know, you can change some settings from the chrome bar in the uwp, but not fully customize it by default.
The starting point for doing so would be the ApplicationView's TitleBar property.
This allows you to change the colors of the buttons and the bar itself:
var titleBar = ApplicationView.GetForCurrentView().TitleBar;
if (titleBar != null)
{
titleBar.ButtonBackgroundColor = Colors.DarkBlue;
titleBar.ButtonForegroundColor = Colors.White;
titleBar.BackgroundColor = Colors.Blue;
titleBar.ForegroundColor = Colors.White;
}
It is worth mentioning that when running the application on a PC, the control is called TitleBar but on a mobile device, it is called StatusBar. Full example for handling both devices can be found here.
If you need more personalization options, creating your own TitleBar component should be possible, look for the ExtendViewIntoTitleBar property of the CoreApplicationViewTitleBar object.
More info can be found here.
You need to use a resource dictionary with the custom styles. You can import these themes via App.Xaml to apply it.
These links might be of help. If you have any specific questions feel free to ask.
ResourceDictionary and XAML resource references
XAML theme resources

Gtk theme in GTK# (Windows)

I'm trying to change the theme in GTK# (OS: Windows, IDE: Xamarin). But I get next issues:
I was able to find only one theme which correctly render, it is "Orta". All was well, except for lags and freezes. Here is my code:
string Resource_File = "Orta\\gtk-2.0\\gtkrc";
Application.Init ();
Gtk.Rc.AddDefaultFile (Resource_File);
Gtk.Rc.Parse (Resource_File);
MainWindow win = new MainWindow ();
win.Show ();
Application.Run ();
When I changing the size of the Paned or clicking on button I get GUI freezes(I already asked about this). This problem occurs only when using this theme, with the other themes all works tolerably. I used the search and found a couple of opinions, about that this is due to the use of Cairo to render graphics (one of them).
if I try to use a different theme, a lot of GUI elements not correctly rendered in my GTK# application, but they are correctly render in the GTK Theme Selector. If the theme is displayed correctly in GTK Theme Selector, then I try to use the selected gtkrc file in my Gtk# app(as shown in Example with "Orta"), but almost always, most widgets are not displayed correctly(here is an example)
So I have a few questions:
How to choose a work theme?
How to set a theme for GTK# (Windows)?
What Gtk# open source application using the theme and how?
What other way to change the style of GUI in the GTK# app?
Why "Orta" theme freezes?
So I need any your help!
Thanks!
I know it's an old question, but I've been fighting with themes lately.
It turns out that when running a Gtk# app build with Xamarin, theme issues will appear because it seems that some "Windows-like" theme is forced into the code.
When running the application from Xamarin Studio, depending on the .Net framework (Microsoft .NET 4.5, Mono 3.3.0, Mono 4.0.1) the behaviour was different. And I had a warning with Mono 3.3.0, telling me the 'Xamarin' engine could not be found.
I ended up with the following code :
Application.Init ();
Gtk.Settings.Default.ThemeName = "Theme/gtk-2.0/gtkrc";
Gtk.Rc.Parse ("./Theme/gtk-2.0/gtkrc");
Where gtkrc is my theme. Without setting the default theme name, nothing worked correctly. I didn't go very far into customizing my theme, so I can't tell if it solves every theme issue.