I have a periodic task that updates my live tile. Basically it looks like this:
var tileData = new FlipTileData()
{
BackgroundImage = mediumFrontUrl,
BackBackgroundImage = mediumBackUrl,
WideBackgroundImage = wideFrontUrl,
WideBackBackgroundImage = wideBackUrl
};
ShellTile primaryTile = ShellTile.ActiveTiles.First();
if (primaryTile != null)
{
primaryTile.Update(tileData);
}
There are certain occasions where I would like to not display the BackBackgroundImage and WideBackBackgroundImage. How do I clear the values? Simply setting things to null doesn't work (it just keeps what was there previously). According to the docs if I use XAML to create the live tile I can set Action="Clear". How do I set that in code?
You can clear the property for each Tile property.
For BackBackgroundImaga it's Empty URI:
BackBackgroundImage = new Uri("", UriKind.Relative)
More info on msdn page Tiles Overview for Windows Phone:
http://msdn.microsoft.com/en-us/library/hh202948%28v=vs.92%29.aspx
Hope this help
Best regards
And Zik
Just one trick.
Playing with WideBackContent and putting my own image (I have a lot of more possibilities with this apporach) I have problem with resetting WideBackContent. The thing that help me is not WideBackContent ="", then WideBackContent = " "
So, one empty space solved my problem.
Best regards
Related
I need to get rid of only the arrow in the navigation bar in Xamarin forms. I tried in but I didn't get a proper solution. please help me overcome this issue. Thanks in advance.
!! I NEED TO REMOVE PERMANENTLY
solutions that I'm tried up to now :
Shell.SetBackButtonBehavior(this, new BackButtonBehavior
{
IsEnabled=false
});
but still, this didn't help me
There is a easy workaround to solve this.
You could override a Icon with a transparent png file(Follow is a transparent png):
and set enabled be false as follows:
Shell.SetBackButtonBehavior(this, new BackButtonBehavior
{
IconOverride = "transparent.png",
IsEnabled = false
}) ;
Then the effect as follows:
Note: You will see that we also can tap that area, therefore we need to set enabled be false.
Based on this official sample to test that.
You can set this using the Xamarin.Forms.NavigationPage class, from within a view's code behind file. E.g. within a ContentPage's constructor.
NavigationPage.SetHasBackButton(this, false);
Following the example on the website: https://vega.github.io/editor/#/examples/vega-lite/interactive_bar_select_highlight
I want to programmatically set the selections via signals. I realize that I could emulate a click by doing the following
VEGA_DEBUG.view.signal("select_tuple", {"unit":"","fields":[{"type":"E","field":"_vgsid_"}],"values":[1]})
However, I cannot proceed to select another, e.g., the shift select of the 2
VEGA_DEBUG.view.signal("select_tuple", {"unit":"","fields":[{"type":"E","field":"_vgsid_"}],"values":[2]})
This makes sense, since only shift-click accumulates the state.
I tried modifying the accumulated signal
VEGA_DEBUG.view.signal("select", {"_vgsid_":[1,2],"vlMulti":{"or":[{"_vgsid_":1},{"_vgsid_":2}]}})
However, this does not help. Is this not possible? I understand that a custom solution may be possible in hand-rolled vega, as opposed to that compiled from vega-lite.
Thanks.
Just need to set VEGA_DEBUG.view.signal("select_toggle", true) before adding the new select!!
After much research I made this example of how to change the vega-lite brush programmatically
https://observablehq.com/#john-guerra/update-vega-lite-brush-programmatically
Using #koaning example this stack overflow question I figured that you can change the brush by updating "brush_y" (assuming that your selection is called brush) or change the selection using "brush_tuple" (which doesn't seem to update the brush mark)
viewof chart = {
const brush = vl.selectInterval("brush").encodings("y");
const base = vl
.markBar()
.select(brush)
.encode(
vl.x().count(),
vl.y().fieldQ("Horsepower"),
vl.color().if(brush, vl.value("steelblue")).value("gray")
)
.height(maxY);
return base.data(data).render();
}
update = {
// From https://codepen.io/keckelt/pen/bGNQPYq?editors=1111
// brush_y -> brush_tuple -> brush
// Updates on pixels
chart.signal("brush_y", [by0, maxY / 2]);
await chart.runAsync();
}
Crossposting here in case it might be useful for anyone
i've recently installed Alfresco's PDF-Toolkit. My actual intension is to use it in a Javascript manner. This is because the value i need or want to watermark will be based on the Document's Property/Aspect.
i failed to find any tutorial or guide regarding this issue. if anyone can please give me a walkthrough, i'd really appreciate it.
my current script looks like this:
var watermark_action = actions.create("pdf-watermark");
watermark_action.parameters["destination-folder"] = ????;
watermark_action.parameters["watermark-type"] = "text";
watermark_action.parameters["watermark-text"] = aspect.ajie;
watermark_action.parameters["watermark-pages"] = "all";
watermark_action.parameters["watermark-depth"] = "over";
watermark_action.parameters["position"] = "center";
watermark_action.execute(document);
NOTE: i actually found one, the problem is that this one is an image watermark and what i want or need is a text watermark. also i need the script to save the watermarked copy to the same directory which i believe is not what the guide seems to do.
the last thing i need is the value for the destination-folder parameter. i really have no clue on how or what i'll place here just to save the pdf to the same folder. hoping to get some guide, tips, and tricks here. thanks
The code should look like this:
var watermark_action = actions.create("pdf-watermark");
watermark_action.parameters["inplace"] = true;
watermark_action.parameters["destination-folder"] = document.parent;
watermark_action.parameters["watermark-type"] = "text";
watermark_action.parameters["watermark-text"] = "Lorem Ipsum";
watermark_action.parameters["watermark-font"] = "Helvetica";
watermark_action.parameters["watermark-size"] = "14";
watermark_action.parameters["page"] = "all";
watermark_action.parameters["watermark-depth"] = "over";
watermark_action.parameters["position"] = "center";
watermark_action.execute(document);
You were missing watermark-font, watermark-size, and page.
I'm trying to create functionality very similar to most websites these days.
The concept is 3 sections the size of the browser, the background images are supposed to be fixed positioned and revealed by the div scrolling up and down.
We need this to function as beautifully on mobile as it does on desktop, and it looks like Famous/angular is the solution.
Here is a pen.
http://codepen.io/LAzzam2/pen/XJrwbo
I'm using famous' Scroll.sync, firing javascript that positions the background image on every start / update / end.
scrollObject.sync.on("update", function (event) {
console.log('update');
test(event);
});
here is the function positioning the backgrounds.
function test(data){
var scroller = document.getElementsByClassName('famous-group');
styles = window.getComputedStyle(scroller[0], null);
tr = styles.getPropertyValue("-webkit-transform").replace('matrix(1, 0, 0, 1, 0,','').replace(')','');
var distanceTop = -(parseInt(tr));
var sections = document.getElementsByClassName('section');
sections[3].style.backgroundPosition="50% "+distanceTop+"px";
sections[4].style.backgroundPosition="50% "+(-(window.innerHeight)+distanceTop)+"px";
sections[5].style.backgroundPosition="50% "+(-(window.innerHeight*2)+distanceTop)+"px";
};
Any input / suggestions / advice would be wonderful, really just looking for a proof of concept with these 3 background images scrolling nicely.
That jittery-ness is unfortunate, I can't tell what would be causing the issue, except maybe the order in which events are fired?
**There are known issues, only works in -webkit browsers as of now
I think your idea to use Famous is good, but probably what I would do, would be taking a different approach to the problem.
You are solving this by touching the DOM, that is exactly what both Angular and Famous are meant to avoid.
If I had to face the same goal, I would probably use a Famous surface for the background instead of changing the property of the main one and synchronize its position with the scrolling view.
So, in your code, it would be something like this:
function test(data){
var scrollViewPosition = scrollObject.getAbsolutePosition();
var newBackgroundPosition = // Calculate the new background position
var newForegroundPosition = // Calculate the new foreground position
var backgroundSurface = backgroundSurface.position.set(newBackgroundPosition);
var foregroundSurface = foregroundSurface.position.set(newForegroundPosition);
};
I'm stuck with this problem and simply cannot get it solved, sorry if there was another post about this already but I couldn't find it as well.
On to the problem then: I'm trying to make a simple function capable of initializing and updating bitmaps, and a few other variables I haven't thought of yet, when needed.
I created on the stage some MovieClips called slot0, slot1, slot2 etc... inside another MovieClip called ButtonRootPannel in order to have a visual of where I'll be putting the images without having to guess numbers in the code.
Together with those I set up this code:
var buttons_rootArray:Array = new Array;
for(var i=0;i<=11;i++){
this["slot"+i] = this.ButtonRootPannel.createEmptyMovieClip("slot"+i, i);
this["slot"+i].customState = "Inactive"; //Active, Inactive or Unavaiable
this["slot"+i]._x = eval("_root.ButtonRootPannel.slot"+i)._x;
this["slot"+i]._y = eval("_root.ButtonRootPannel.slot"+i)._y;
this["slot"+i]._width = eval("_root.ButtonRootPannel.slot"+i)._width;
this["slot"+i]._height = eval("_root.ButtonRootPannel.slot"+i)._height;
buttons_rootArray.push(this["slot"+i]);
}
UpdateButtonsSlot(0,"BuildButton");
UpdateButtonsSlot(1,"CancelButton");
function UpdateButtonsSlot(slot:Number, newImage:String):Void{
var tempData:BitmapData = BitmapData.loadBitmap(newImage);
var tempClip:MovieClip = eval(buttons_rootArray[slot]);
//buttons_rootArray[slot].unloadMovie();
//buttons_rootArray[slot].clear();
tempClip.attachBitmap(tempData,this.getNextHighestDepth(),"auto",true);
}
Anyone knows what I might be doing wrong?
Thanks in advance.
Well, problem solved, this now seems to be working for some strange reason:
for(var i=0;i<=11;i++){
var currentMC = eval("_root.ButtonRootPannel.slot"+i);
this["slot"+i] = this.ButtonRootPannel.createEmptyMovieClip("slot"+i, i);
this["slot"+i].customState = "Inactive"; //Active, Inactive or Unavaiable
this["slot"+i]._x = currentMC._x;
this["slot"+i]._y = currentMC._y;
//this["slot"+i]._width = currentMC._width;
//this["slot"+i]._height = currentMC._height;
buttons_rootArray.push(this["slot"+i]);
}
Only those commented lines makes the MovieClip disappear if I uncomment them. Will just leave them out then and problem solved.