Using ms-resource in .xaml at windows 8 app - xaml

How can I use ms-resource in page XAML file?
<Button Name="btn_SaveNote" Content="ms-resource:Done" ></Button>

If you want to use Strings from resource files in your windows 8 app.
Then use this
<Button x:Uid="StringName" Content="">
and in resource file it should be defined as
StringName.Content

Related

images from static folder in nuxt 3 doesn't show

I'm using Nuxt 3
and this is directories structure
images are loaded like this
<img src="/images/index/pic-left.svg" />
I've also tried (start without / )
<img src="images/index/pic-left.svg" />
and it didn't worked again
What's the problem ?
In Nuxt3, the directory is now public and not static.
So it should be /images/index/pic-left.svg.

onclick in Core 3.1 Blazor app doesn't work

I just installed Visual Studio 2019 (v16.4.3, immediately updated to 16.4.4). I have VS2017 on my system, but no prior versions of VS2019.
I created a new Blazor app project. It automatically created Index, Counter, and other pages. It created it as a .NET Core 3.1 app (as 3.1 is now installed automatically with VS2019 v16.4 and later, apparently).
I am literally following this "Get started" page:
https://learn.microsoft.com/en-us/aspnet/core/blazor/get-started?view=aspnetcore-3.1&tabs=visual-studio
I run the app with no changes from what was generated. Clicking the button on the Counter page does nothing. I don't see any messages in the Debug Output window that have any relations.
I did some searches and found reports of similar issues but the solutions don't seem to apply.
Any idea what is wrong? (it is SO annoying when a freshly generated, unmodified project does not work!)
The code for the Counter page was generated as:
#page "/counter"
<h1>Counter</h1>
<p>Current count: #currentCount</p>
<button class="btn btn-primary" #onclick="IncrementCount">Click me</button>
#code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}
_Host.cshtml is:
#page "/"
#namespace ToDoList.Pages
#addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
#{
Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ToDoList</title>
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />
</head>
<body>
<app>
<component type="typeof(App)" render-mode="ServerPrerendered" />
</app>
<div id="blazor-error-ui">
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
Reload
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.server.js"></script>
</body>
</html>
Update:
Per comment suggestions:
I rebooted my computer
Went straight into VS2019 and created a New Project. Selected Blazor App. Accepted all defaults. So, ended up with a project named BlazorApp1.
Hit F5 to start it up. Same results. Clicking the 'Click me' button the Counter does not do anything.
Entire contents of BlazorApp1.csproj:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>
Note that the Get Started link I am following specifically says to use .NET Core 3.1 (vs 2.1). It says to OPTIONALLY update to the 3.2 preview, but that's only needed if I want to do a Blazor WebAssembly (which I don't). I prefer to only have released code on my system, so I don't want to updated to 3.2 Preview for something that is supposed to work with 3.1.
VS2019 defaulted to launching the app in Internet Explorer.
I changed it to launch it in Edge. It works in Edge.
Final update:
I got it to work in IE11. To do so:
I downloaded the Daddoon Blazor Polyfill package from here:
https://github.com/Daddoon/Blazor.Polyfill
From the downloaded zip, I copied Publish\Blazor.Polyfill.Publish\blazor.polyfill.min.js to a subfolder that I created, named "js", under the wwwroot subfolder in my project folder. I.e. in ToDoList\wwwroot, I created a subfolder named 'js' and then copied the blazor.polyfill.min.js file into that subfolder.
Then, I edited the file _Host.cshtml. I added the first line here (in front of the second line, which was already there, generated by VS and the Blazor Server template):
<script src="js/blazor.polyfill.min.js"></script>
<script src="_framework/blazor.server.js"></script>
I found a bunch of things that said "use Polyfills", but I couldn't find anything that said "here is how you actually do that." So, hopefully this helps someone else. Also, if I did something in a way that is suboptimal, hopefully someone will see this and tell me how to do it in a better way.
I had the same problem
To solve it, go to your project's Properties >> Debug >> uncheck Enable SSL. Then run your project by clicking e.g. IIS Express.

IntelliJ *.gtmpl juzu files

I'm building a Juzu project for portlet development for eXo Platform with IntelliJ.
The problem is that I have template files that are index.gtmpl, and I can have HTML coding inside it, but the file opens as a simple text file.
Is there a plugin on a configuration that I'm missing?
Thanks!
================= ** EDIT ** ============================
My file looks like this:
editMode.gtmpl
#{param name=enableComment/}
<form action="#{JuZcretApplication.enableComment()}" method="POST" role="form">
<h5>Configuration</h5>
<input type="checkbox" name="enableComment" <%=enableComment ? "checked" : "" %>/>Enable Comment
<button type="submit">Save</button>
</form>
You can associate *.gtmpl files with the HTML editor:
Open File > Settings > Editor > File Types > HTML files and add your extension to registered patterns in the right panel.
Source
[UPDATE]
[SOLVED]
I did some further digging in the matter and found a better solution to the issue:
If you associate the *.gtmpl file as a File > Settings > Editor > File Types > Groovy Server Page.
It's not a complete solution but IntelliJ, as mentioned by #darek-kay, does not support these files.

ImageResizer simply not resizing images

I have an ASP.NET MVC 3 project, and I installed the ImageResizer Mvc Web.Config package, which added all necessary components, and modified my Web.Config file for me.
I have the following code in my MVC View:
<div id="heroimage" class="slideshow">
<div>[LEFT]</div
<div>[RIGHT]</div>
<div>[INDICATOR]</div>
#foreach (ICMSElement oHeroImage in Model.Elements("HeroImage")){
<img src="images/#oHeroImage.Value" />
}
</div>
<div id="image-strip" class="viewer">
<div class="slider">
<ul>
#foreach (ICMSElement oHeroImage in Model.Elements("HeroImage")){
<li><img src="images/#oHeroImage.Value?width=100&height=100"></li>
}
</ul>
</div>
</div>
The images contained in the second div are not being resized. There is no css for the width and height that would be overriding the resizing.
In the troubleshooting page for the ImageResizer, it is stated that if an image cannot be resized, it could be one of the following causes:
You did not register the HttpModule properly in both places of your Web.config file.
(I used the NuGet package that modified the Web.Config for me)
You are using IIS 6 (or earlier), or IIS7 Classic Pipeline, and are not using the .jpg.ashx syntax, and you have not mapped all requests to the ASP.NET runtime.
(My IIS server is running IIS 7 in Integrated mode)
You are using ASP.NET MVC (and have conflicting routes), but do not have the MvcRoutingShim plugin installed.
(The MvcRoutingShim plugin is installed according to the debug page)
You are mistyping the querystring commands.
(I am not doing this in the code snippet above)
The original image is smaller than the size you are requesting, and you are not using &scale=both (The default behavior is to never upscale images, but this can be changed)
(The default image size in this case is 1280x800)
My Resizer.Debug output is here: https://gist.github.com/Thoth2020/11197160
My website is using a base tag in the Layout page, however it is not adjusting the src attribute of the img. For example, the page I am looking at renders this img tag:
<img src="images/00100010_1200_800_slideshow_03.jpg?width=100&height=100">
Which is the same as the snippet above with the Razor syntax interpreted.
So, I guess I am at a loss as to why this is not functioning correctly.
You have an existing controller or another HttpModule that is interfering with ImageResizer. One workaround is to use the fakeExtensions feature to avoid matching those routes. This makes your URLs look like image.jpg.ashx?width=400 instead of image.jpg?width=400.
If your CMS abstracts away image storage, and does not implement VirtualPathProvider, you may need to implement an IVirtualImageProvider to bridge the gap between your CMS data layer and ImageResizer.
Typically, however, you can use one of our existing storage plugins (SqlReader, S3Reader, VirtualFolder, RemoteReader) to access the data store directly instead.
I had the same issue. the imageResizer was saving and showing images just fine but none of the resizing and cropping or rotating functions would work.
My problem solved by simply adding two nuget packages with Install-Package ImageResizer.WebConfig and Install-Package ImageResizer to my web project. I had them on my class library project that was doing all the logic stuff but it seems they are also needed on the running assembly either web app or desktop.

primefaces fileupload dialog with file filter extension mode="simple"

How to add file filter condition in primefaces 3.5 fileUpload tag,
Its displaying only "All Files" option.
<h:form enctype="multipart/form-data">
<p:fileUpload value="#{demoBean.file2}"
mode="simple" allowTypes="/(\.|\/)(xls|xlsx)$/" />
</h:form>
please advice...
File Upload In Simple mode
allowTypes
filesize
and some other attributes are not working In Primefaces.
If you want to use them then change mode from simple to advance or remove attribute of mode because by default mode is advance.